Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving Prefab to immutable folder is not allowed. #3593

Open
yyyyyuliu opened this issue Aug 29, 2024 · 3 comments
Open

Saving Prefab to immutable folder is not allowed. #3593

yyyyyuliu opened this issue Aug 29, 2024 · 3 comments
Assignees
Labels
P3 Low priority issue. Sample Issue with samples.

Comments

@yyyyyuliu
Copy link

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2022.3.42f1
  • Google Mobile Ads Unity plugin version: 9.2.0
  • Plugin installation method: Unity package manager(OpenUPM)
  • Platform: Unity Editor
  • Platform OS version: macOS 14.5
  • Any specific devices issue occurs on: Editor
  • Mediation ad networks used, and their versions: Only Google Admob

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  1. I created the following script in a new project

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;

public class test : MonoBehaviour
{
// These ad units are configured to always serve test ads.
#if UNITY_ANDROID
private string _adUnitId = "ca-app-pub-3940256099942544/6300978111";
#elif UNITY_IPHONE
private string _adUnitId = "ca-app-pub-3940256099942544/2934735716";
#else
private string _adUnitId = "unused";
#endif

BannerView _bannerView;
public void Start()
    {
        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(initStatus => { LoadAd(); });
    }

// Update is called once per frame
void Update()
{
    
}

public void CreateBannerView()
{
    Debug.Log("Creating banner view");

    // If we already have a banner, destroy the old one.
    if (_bannerView != null)
    {
        DestroyAd();
    }

    // Create a 320x50 banner at top of the screen
    _bannerView = new BannerView(_adUnitId, AdSize.Banner, AdPosition.Top);
}

/// <summary>
/// Creates the banner view and loads a banner ad.
/// </summary>
public void LoadAd()
{
    // create an instance of a banner view first.
    if(_bannerView == null)
    {
        CreateBannerView();
    }

    // create our request used to load the ad.
    var adRequest = new AdRequest();

    // send the request to load the ad.
    Debug.Log("Loading banner ad.");
    _bannerView.LoadAd(adRequest);
}
/// <summary>
/// Destroys the banner view.
/// </summary>
public void DestroyAd()
{
    if (_bannerView != null)
    {
        Debug.Log("Destroying banner view.");
        _bannerView.Destroy();
        _bannerView = null;
    }
}

}
`
2.When running a scene, choose to mount this scripted game object.
3.Cancel the run, change the active of this gameobject in inspector to false and then to true, save the scene
4.The following error will be generated

Saving Prefab to immutable folder is not allowed: Packages/com.google.ads.mobile/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/BANNER.prefab UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Here are the source files
归档.zip

@yyyyyuliu
Copy link
Author

This guy has the same problem as me.#3350

@NVentimiglia
Copy link
Member

These prefabs are for demonstration and are not intended for modification. That said, I will look into a fix for the issue.

@NVentimiglia NVentimiglia self-assigned this Oct 1, 2024
@NVentimiglia NVentimiglia added P3 Low priority issue. Sample Issue with samples. labels Oct 1, 2024
@AndrewShields
Copy link

i'm having the same issue with almost identical setup on windows

Saving Prefab to immutable folder is not allowed: Packages/com.google.ads.mobile/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/1024x768.prefab
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority issue. Sample Issue with samples.
Projects
None yet
Development

No branches or pull requests

4 participants
@NVentimiglia @AndrewShields @yyyyyuliu and others