Unity/Unity 이슈 38

VideoPlayer에서 Graphics device is null

Error VideoPlayer 접근 시 아래와 같은 에러 발생. Graphics device is null. ① Firebase에 Login한 이후에 VideoPlayer 접근 시 발생 ② Editor에서는 아무 이상 없으나 Android 디바이스에 빌드해서 실행할 때 발생 ③ 최초 1회는 괜찮으나, 2회째 실행부터 발생 ④ 다른 씬으로 이동해서 VideoPlayer실행하면 괜찮음 .Firebase로그인이 일어난 씬에서 문제발생. Solution Unity자체의 버그 같음. Firebase ,Admob 사용시 이런 류의 버그가 발생하는 것 같음. 이것저것 해보다가.. 아무래도 Thraed문제인것 같아, 문제가 발생하는 부분을 코루틴으로 빼서 동작했더니 버그 없이 정상동작. private IEnumera..

Unity/Unity 이슈 2024.03.24

Admob 리워드 광고 로드 실패

Problem 리워드 광고 요청이 안됨 로그 추출 코드 public void Start() { RequestRewardAd(); } private void RequestRewardAd() { Debug.Log("RequestRewardAd"); rewardedAd = new RewardedAd(adUnitId); // Called when an ad request has successfully loaded. rewardedAd.OnAdLoaded += HandleRewardedAdLoaded; rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad; rewardedAd.OnAdOpening += HandleRewardedAdOpening; rewarde..

Unity/Unity 이슈 2022.12.26

Unity 구글 로그인 실패 Case #4

Problem Admob, GooglePlayService를 업데이트 하는 과정에서 아래 에러 발생 DllNotFoundException: Unable to load DLL FirebaseCppApp-7_2_0. Tried the load the following dynamic libraries: Unable to load dynamic library FirebaseCppApp-7_2_0 because of Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-7_2_0" not found Solution Firebase(Firestore) 버전 업데이트 전체적으로..

Unity/Unity 이슈 2022.12.23

Unity 구글 로그인 실패 Case #3

Problem 구글 로그인 건드리다가 발생한 에러. APK빌드 후 Phone에 설치 후 실행하면 바로 Crash. Unity로그가 아니라 일반 로그에서 에러발생. (구글검색하면 Unity가 아닌 Android 개발 해결방법이 주로 나와서 헷갈림) Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Solution implementation 'androidx.work:work-runtime:2.7.1' 위 코드 추가 *안되면 force reslove 참고: https://stackoverflow.com/questions/72..

Unity/Unity 이슈 2022.12.23

Unity 구글 로그인 실패 Case #1

Problem 원래 잘 되던 구글로그인이 라이브러리 업데이트 후 먹통이 됨 APK로 빌드 후 Phone에서 실행 시 아래와 같은 로그(Exception에러는 아님) : Returning an error code. : GooglePlayGames.Android.c__DisplayClass18_0:b__0(Int32) : System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaPr..

Unity/Unity 이슈 2022.12.23

Addressable 버전 업 이후 제대로 작동을 하지 않는 경우

Problem System.Exception: Unable to load dependent bundle from locationUnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/c__DisplayClass57_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)DelegateList`1:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/Resou..

Unity/Unity 이슈 2022.11.30

Child Object 삭제 시 유의

https://zimamderotech.tistory.com/89 자식 객체 Destroy 할 때 주의 transform.childCount ------ (1) Destroy(child.gameObject) transform.childCount ------ (2) 위와 같이 자식 객체를 지웠을 때, (1)과 (2) 값은 같다. 화면에서도 지워야 chil.. zimamderotech.tistory.com protected void RemoveAllChild(Transform targetParent) { var children = targetParent.transform.GetComponentsInChildren(true); foreach (var child in children) { if (child ==..

Unity/Unity 이슈 2022.07.11

싱글톤 GameObject가 계속 늘어날 때

Problem 싱글톤 오브젝트가 씬 생성시마다 계속 늘어난다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Singleton : MonoBehaviour where T : MonoBehaviour { private static T instance; public static T Instance { get { if(instance == null) { GameObject obj; obj = GameObject.Find(typeof(T).Name); if (obj == null) { obj = new GameObject(typeof(T).Name); instance = obj.AddCompon..

Unity/Unity 이슈 2022.03.27

[Addressable] JSON parse error: Invalid value.

Problem ArgumentException: JSON parse error: Invalid value. Bundle사이즈를 체크하는 과정에서 위 에러가 발생. (이 경우는 BOM관련 문제는 아님.) public IEnumerator CheckBundle() { AsyncOperationHandle downloadSize = Addressables.GetDownloadSizeAsync(assetLabel.labelString); yield return downloadSize; if (downloadSize.Result > 0) { DownloadBundle(); } else { LoadLoginScene(); } } Solution TextDataProvider.cs private void Reques..

Unity/Unity 이슈 2022.02.27

[구글로그인] DEBUG: Authentication canceled

[Play Games Plugin 0.10.12] 02/27/22 1:00:07 +09:00 DEBUG: Authentication canceled 게임안에서 구글로그인 요청 시, 위 에러가 나며 구글 로그인이 안된다. 테스트용으로 새로운 구글 아이디를 만들었고, 폰에 apk를 설치해서 실행한 상태. 이 경우는 여기에 테스터로 등록이 안되어 있어서 그랬음. 참고 블로그 https://blog.naver.com/PostView.nhn?blogId=mms0801&logNo=222277972187&categoryNo=0&parentCategoryNo=57&viewDate=&currentPage=1&postListTopCurrentPage=1&from=postView [Unity][GooglePlay][GPGS..

Unity/Unity 이슈 2022.02.27

Exception: Reentering the Update method is not allowed. This can happen when calling WaitForCompletion on an operation while inside of a callback.

Problem GameObject loading = Addressables.InstantiateAsync("Assets/Addressable/UI/Loading/LoadingPrefab.prefab", parent).WaitForCompletion(); Exception: Reentering the Update method is not allowed. This can happen when calling WaitForCompletion on an operation while inside of a callback. Solution 검색해서 나오는 글들을 보면, Addressable자체 버그인듯 함. 그래서 어찌 해결할 방안이 없음. Coroutine(IEnumerator)안에서 WaitforComplete를..

Unity/Unity 이슈 2022.02.19

Addressable 사용 시 Shader가 깨질 때(분홍색으로 나옴)

Problem Reason Addresssable의 Shader는 Android용으로 Pack되어서 Editor에서 안열리는 것 Solution Android에서는 잘 보이고, Editor에서 테스트 시에만 잘 안보이는 것. Reference http://cargocollective.com/mingruijiang/Shaders-from-asset-bundles-appear-pink-in-editor Shaders from asset bundles appear pink in editor - Mingrui Jiang, Programmer I came across this problem when testing asset bundles and organizing shaders. The problem is wei..

Unity/Unity 이슈 2022.02.14

Button에 AddListner에 함수를 넣어도 먹히지 않는 상황

Problem public void SetCancelClickListener(UnityAction listener) { cancelButton.onClick.AddListener(AAAA); cancelButton.onClick.AddListener(listener); } private void AAAA() { Debug.Log("#### AAAA()"); } // 다른 클래스에서 매개변수로 들어간 UnityAction(listener) private void SSSS() { Debug.Log("#### SSSS()"); } #### SSSS()는 찍히지만 #### AAAA()는 찍히지 않는다. 해당 AddListner라인만 쌩깜. Solution 해당 클래스는 Monobehabior이지만 new로 생성..

Unity/Unity 이슈 2022.02.13