블로그 이미지
Every unexpected event is a path to learning for you. blueasa

카테고리

분류 전체보기 (2806)
Unity3D (862)
Script (91)
Extensions (16)
Effect (3)
NGUI (81)
UGUI (9)
Physics (2)
Shader (37)
Math (1)
Design Pattern (2)
Xml (1)
Tips (201)
Link (23)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (80)
Trouble Shooting (70)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (12)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (15)
Ad (14)
Photon (2)
IAP (1)
Google (11)
URP (2)
Android (51)
iOS (45)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (234)
협업 (61)
3DS Max (3)
Game (12)
Utility (140)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (55)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

[에러 내용]

  • 기기에서 앱을 실행하면 'dyld: Library not loaded: @rpath/FBAudienceNetwork.framework' 오류와 함께 바로 중단됩니다. 이 오류는 앱에 Audience Network SDK를 포함하지 않았다는 것을 의미합니다. 타겟 설정으로 이동하고 '일반' 탭에서 'FBAudienceNetwork.xcframework'에 '포함 및 서명'을 선택하세요.

 

[해결방법]

출처 링크의 내용에서는 Xcode에서 처리하는 방법을 써놨는데, 유니티 사용하는 상황에서 추가 작업을 Xcode에서 하면 귀찮아져서 Xcode PostProcessor에서 아래 소스 추가함.

[추가한 소스코드] pbxProject.AddFrameworkToProject(targetGuid, "FBAudienceNetwork.framework", true);

 

 

[출처] https://developers.facebook.com/docs/audience-network/setting-up/platform-setup/ios/add-sdk?locale=ko_KR

 

SDK 추가 - Audience Network - 문서 - Facebook for Developers

SDK 버전 6.9.0 이상에 대한 문제 해결 6.9.0부터는 iOS Audience Network SDK에서 Swift를 지원합니다. SDK 설치 및 Swift 상호운용성과 관련하여 가장 일반적으로 발생하는 문제를 해결하려면 아래의 내용을

developers.facebook.com

 

반응형
Posted by blueasa
, |

[문제]

캐릭터가 카메라에 가까이 있어서 캐릭터의 일부만 보일 때, 손 등 일부가 렌더링이 되지 않음.

 

[원인]

캐릭터의 일부(손) 기본 자세 Bound가 카메라 밖에 있어서 카메라 안쪽에 없다 판단하고 렌더링을 하지 않고 있음

 

[해결]

Mesh Renderer의 Update When Offscreen 옵션을 true(체크)로 변경

 

 

[참조] https://docs.unity3d.com/kr/2018.4/Manual/class-SkinnedMeshRenderer.html

 

스킨드 메시 렌더러 - Unity 매뉴얼

Unity는 메시의 모양이 미리 정의된 애니메이션 시퀀스에 따라 변형되는 Bone 애니메이션의 렌더링을 위해 Skinned Mesh Renderer 컴포넌트를 사용합니다. 캐릭터 뿐만 아니라 (조인트가 힌지처럼 기능

docs.unity3d.com

오프스크린일 때 업데이트(Update When Offscreen)

기본적으로 어떤 카메라에도 보이지 않는 스킨드 메시는 업데이트 되지 않습니다. 메시가 스크린에 다시 나타날 때까지 스키닝은 업데이트 되지 않습니다. 이는 시스템을 절약하기 위해서입니다.

오브젝트의 가시성은 메시의 Bounds 에서 결정됩니다(전체 바운딩 영역은 모든 활성화된 카메라의 뷰 밖에 있어야 합니다). 하지만 애니메이션 메시의 트루 바운딩 영역은 애니메이션이 재생되면서 변경될 수 있습니다(예를 들어 캐릭터가 공중으로 손을 들어 올리면 영역은 커집니다). Unity는 최대 바운딩 영역을 계산할 때 첨부된 모든 애니메이션을 고려하지만 일어날 만한 모든 경우를 예측하기 위해 바운드를 계산할 수 없는 경우도 존재합니다.

다음의 각 예제 상황은 뼈대나 버텍스를 미리 계산된 바운딩 영역 밖으로 밀어낼 때 문제가 됩니다.

  • 런타임에 애니메이션이 추가된 경우
  • 추가 애니메이션
  • 스크립트에서 뼈대의 포지션을 순서대로 바꿀 때
  • 버텍스를 미리 계산된 바운드 바깥으로 밀어내는 버텍스 셰이더를 사용할 때
  • 래그돌을 사용하는 경우

이런 문제에는 두 가지 해결책이 있습니다.

  1. 바운드를 수정해 메시의 잠재적 바운딩 영역을 일치시키기
  2. Update When Offscreen 을 활성화해 스킨드 메시를 항상 스킨 및 렌더링합니다.

일반적으로 퍼포먼스가 더 나은 첫 번째 옵션을 사용해야 합니다. 하지만 퍼포먼스가 주요 관심사가 아니거나 (래그돌을 사용할 때처럼)바운딩 영역의 크기를 예측할 수 없는 경우에 두 번째 옵션을 추천합니다.

스킨드 메시가 래그돌과 더 잘 작동하기 위해 Unity는 임포트할 때 스킨드 메시 렌더러를 루트 뼈대에 자동으로 리맵합니다. 하지만 이는 모델 파일에 스킨드 메시 렌더러가 하나일 때만 해당됩니다. 이는 스킨드 메시 렌더러 전체를 루트 뼈대이나 자식에 첨부하지 못하고 래그돌을 사용하면 이 최적화를 해제해야 함을 뜻합니다.

반응형
Posted by blueasa
, |

techyworm10 commented 15 days ago

@chkuang-g I created fixed editor dll files (until it will be officially fixed):
https://github.com/techyworm10/firebase-unity-sdk-editor-python-fix

 

techyworm10 commented 3 days ago

@daltonbr Did you try to clear ./Library/PackageCache folder?

 

 

[출처] https://github.com/firebase/quickstart-unity/issues/1232

 

[Bug] Python2 is removed on macOS 12.3 !! Please update the Editor script · Issue #1232 · firebase/quickstart-unity

[REQUIRED] Please fill in the following fields: Unity editor version: 2020.3, 2021,2 Firebase Unity SDK version: 7.0 - 8.8 Source you installed the SDK: unitypackage (.unitypackage or Unity Package...

github.com

 

반응형
Posted by blueasa
, |

----------------------------------------------------

Unity 2020.3.27f1

Xcode 13.2.1

FBAEMKit 12.2.1

FBSDKCoreKit 12.2.1

FBSDKCoreKit_Basics 12.2.1

FBSDKLoginKit 12.2.1
GoogleMobileAds 6.1.2
GoogleMobileAds-FacebookUnityAdapter-3.6.0

----------------------------------------------------

회사 플랫폼에서 Firebase Auth를 쓰면서 FBSDK(12.2.1) framework 가 들어가게 됐는데,

여기서 광고를 쓰기 위해 GoogleMoblieAds(6.1.2)를 추가하고,

페이스북 광고를쓰기위해 GoogleMobileAds의 미디에이션인 FacebookUnityAdapter(3.6.0)을 추가했는데..

Android는 잘되는데 iOS에서 에러 남.

 

플러그인 추가 진행 상황은 아래와 같다.

----------------------------------------------------

1) 플랫폼 SDK 추가하면서 FBSDK(12.2.1) 추가

  1.1)Plugins/iOS에 프레임워크 추가 돼 있음(FBAEMKit.framework/FBSDKCoreKit.framework/FBSDKCoreKit_Basics.framework/FBSDKLoginKit.framework)

 

2) GoogleMobileAds(6.1.2) 추가 -> 빌드 잘 됨

 

3) GoogleMobileAds-FacebookUnityAdapter(3.6.0) 추가 -> 빌드 에러

  3.1) [에러메시지] Undefined Symbols for architecture arm64: "_OBJC_CLASS_$_GAD...

  3.2) [해결방법] Unity Editor-Menu-External Dependency Manager-iOS Resolver-Settings : Link frameworks statically <- 체크

  3.3) [참조] https://blueasa.tistory.com/2587

 

4) 3) 해결 후, 빌드는 되는데 런타임에서 에러 남 -> 런타임 에러

  4.1) [에러메시지] Library not loaded: @rpath/FBAEMKit.framework...

    4.1.1) [추천] 4.2.4 방식 먼저 시도

  4.2.) [해결방법] 구글링 하다보니 아래와 같은 내용이 있음.

     4.2.1) General->Frameworks, Library, and Embedded Content. If it's "Do Not Embed", change to "Embed Without Signing"

      (참조: https://stackoverflow.com/questions/58144104/xcode11-dyld-library-not-loaded-reason-image-not-found)

    4.2.2) 빌드하고 수정하긴 그래서 XcodePostProcessor.cs에 아래 내용을 추가함.

        (처음엔 weak 파라미터를 false로 추가해봤었는데 여전히 런타임 에러 남)

      [추가소스]

      /// Initialize PbxProject
      var projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
      PBXProject pbxProject = new PBXProject();
      pbxProject.ReadFromFile(projectPath);
      string targetGuid = pbxProject.GetUnityFrameworkTargetGuid();

 

      // 플랫폼 SDK에서 아래 4개 프레임워크를 추가해놔서 여기서도 4개 추가시킴

      pbxProject.AddFrameworkToProject(targetGuid, "FBAEMKit.framework", true); // weak 부분을 true로 넘김

      pbxProject.AddFrameworkToProject(targetGuid, "FBSDKCoreKit.framework", true);

      pbxProject.AddFrameworkToProject(targetGuid, "FBSDKCoreKit_Basics.framework", true);

      pbxProject.AddFrameworkToProject(targetGuid, "FBSDKLoginKit.framework", true);

 

    4.2.3) 위의 4.2.2) 방법이 안된다면 (스크립트로 프레임워크 추가를 안하고) 직접 넣어도 됨

              직접 넣는 건 아래 링크에서 원하는 버전의 FacebookSDK-Static_XCFramework를 다운받아서 추가.

              (iOS는 받아서 압축풀어보면 여러개의 폴더가 나오는데 ios-arm64(또는 ios-arm64_armv7) 폴더를 사용하면 된다)

              [링크] https://github.com/facebook/facebook-ios-sdk/releases

 

Releases · facebook/facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps. - facebook/facebook-ios-sdk

github.com

 

    4.2.3.1) static 프레임워크 추가하고  Undefined symbol: _vDSP 에러가 나면 Accelerate.framework도 추가하자.

                [참조] https://minmong.tistory.com/242

 

페이스북 sdk 빌드 에러 iOS Facebook SDK Static Framework build error

지난 번에 Facebook 심사를 위한 앱검수 얘기를 했었는데요. 페이스북 권한을 사용하는 컨텐츠를 동영상으로 촬영해야 된다고 말씀드렸습니다. 그리고 iOS의 경우는 시뮬레이터 빌드를 준비해야

minmong.tistory.com

 

  4.2.4) 최근(2023-05-10)에 FacebookSDK 버전을 올리려고 확인 해보면서 FacebookSDK_Dynamic.xcframework를 적용해봤는데 이걸로 해도 잘되는 것 같다.

    4.2.4.1) FacebookSDK_Dynamic.xcframework 추가

    4.2.4.2) 기존 Dependencies.xml은 버전 맞춰 주기(난 15.0.0으로 맞춤)

      [참조] <iosPod name="FBSDKLoginKit" version="15.0.0" minTargetSdk="12.0"> </iosPod>

 

 

5) 4)까지 하고 빌드하니 런타임에서도 에러 안나고 잘 됨. -> 빌드 잘 됨

 

6) 빌드 성공!

 

 

[첨언]

결론적으로 GoogleMobileAds가 Static Framework을 강제(Link frameworks statically)하면서 생기는 문제로 보인다.

결국 GoogleMobileAds를 사용해야 된다면 dynamic framework 추가 방식은 불가능하므로, Facebook 관련 SDK 소스를 직접 추가(4.2.3)하는게 맞는 것 같다.

 

반응형
Posted by blueasa
, |

[상황]

Firebase 8.8.0-RemoteConfig 추가하고 연동하면서 에러 발생

 

[에러 메시지]

오류 CS0433 'Task' 형식이 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' 및 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'에 모두 있습니다.

 

[해결방법]

/Parse/Plugins 아래에서 안쓰는 버전의 Unity.Compat, Unity.Tasks 제거

(.NET 4.x 버전을 쓰고 있어서 .NET 3.5 버전 Unity.Compat, Unity.Tasks 제거함)

 

 

[참조] https://drehzr.tistory.com/1080

 

문제해결)error CS0012: The type `System.Threading.Tasks.Task' is defined in an assembly that is not referenced. Consider add

error CS0012: The type `System.Threading.Tasks.Task' is defined in an assembly that is not referenced. Consider adding a reference to assembly 그전의 Firebase 패키지를 처리하는 도..

drehzr.tistory.com

 

반응형
Posted by blueasa
, |

[문제]

Unity 2020.3에서 'UnityEngine.AI.NavMeshAgent'를 사용하는 소스가 있는 에셋을 추가하니 아래와 같은 에러메시지가 뜸.

 

[에러메시지] CS1069: The type name 'NavMeshAgent' could not be found in the namespace 'UnityEngine.AI'.

 

[해결방법] Package Manager-Built-in-AI Enable

[참조] You have to enable the built in package 'AI' in the Package Manager window to fix this error.

 

 

[출처] https://forum.unity.com/threads/cant-find-navmeshagent-data-type.449932/

 

Can't find NavMeshAgent data type

I will make an AI but I can't find the data type. I don't understand what's going on. if you know, how can i fix this? [IMG] As you see, the data...

forum.unity.com

 

반응형
Posted by blueasa
, |

[ErrorMessage] Unexpected character encountered while parsing value: . Path '', line 0, position 0.

 

[Solved] In my case, the file containing JSON string had BOM. Once I removed BOM the problem was solved.

 

[추가] 로드 할 파일 인코딩 타입을 확인해보자.

 

[출처] https://stackoverflow.com/questions/23259173/unexpected-character-encountered-while-parsing-value

 

Unexpected character encountered while parsing value

Currently, I have some issues. I'm using C# with Json.NET. The issue is that I always get: {"Unexpected character encountered while parsing value: e. Path '', line 0, position 0."} So t...

stackoverflow.com

 

반응형
Posted by blueasa
, |

1. 큰 텍스쳐 로드 시 문제

  -> 텍스쳐 사이즈 줄이기

----

We found out that this problem was caused by big textures loaded at the same time.

After removing these big textures the game started up without any problems.

So for everyone that has the same problem.

Check your big textures and check when they are being loaded and try to load.

----

 

2. 동시에 2번의 File IO

  -> 동시에 File IO 안되도록 수정

----

We found out that this problem was caused by using PlayerPrefs.Save() twice at the same time on two different functions, also we had used File.write() at that time. when we save and write files at a different time, this issue solved.

----

 

[출처] https://stackoverflow.com/questions/37279027/java-lang-error-signal-11-sigsegv-code-1-segv-maperr-unity-spine-android

 

java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) Unity Spine Android

Hi I currently have a problem on a app I made where the app crashes on startup or after the intro video. I am working with Unity3D and Spine to create a 2D game for Android and IOS. I have searched

stackoverflow.com

 

반응형
Posted by blueasa
, |

First thing to do was to switch to Unity beta 2018.1. There you have the UnityWebRequest.certificateHandler This allows to set up custom certificate validation. one last thing to do is to create an object extending CertificateHandler to manage Certificate validation. (See here in Unity beta documentation)


Here is the code :

MyMonoBehaviour :

 IEnumerator GetRequest(string uri){
     UnityWebRequest request = UnityWebRequest.Get(uri);
     request.certificateHandler = new AcceptAllCertificatesSignedWithASpecificKeyPublicKey();
     yield return request.SendWebRequest ();
     if (request.isNetworkError)
     {
         Debug.Log("Something went wrong, and returned error: " + request.error);
     }
     else
     {
         // Show results as text
         Debug.Log(request.downloadHandler.text);
     }
 }

 

AcceptAllCertificatesSignedWithASpecificKeyPublicKey :

 using UnityEngine.Networking;
 using System.Security.Cryptography.X509Certificates;
 using UnityEngine;
 // Based on https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning#.Net
 class AcceptAllCertificatesSignedWithASpecificKeyPublicKey : CertificateHandler
 {
 
  // Encoded RSAPublicKey
  private static string PUB_KEY = "mypublickey";
  protected override bool ValidateCertificate(byte[] certificateData)
  {
     X509Certificate2 certificate = new X509Certificate2(certificateData);
     string pk = certificate.GetPublicKeyString();
     if (pk.ToLower().Equals(PUB_KEY.ToLower()))
         return true;
     return false;
  }
 }

 

 

[출처]

answers.unity.com/questions/1479862/unitywebrequest-tomcat-redirect-and-self-signed-ss.html?_ga=2.234326166.94048792.1618987174-1334006087.1612316380

 

UnityWebRequest tomcat redirect and self signed SSL certificate - Unity Answers

 

answers.unity.com

 

반응형
Posted by blueasa
, |

[에러 메시지]

An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Library/unity editor resources'
Asset name: Font Material
(You are probably referencing internal Unity data in your build.)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

 

[해결방법]

유니티 자체 폰트 중 Arial을 제외한 다른 자체 폰트를 쓰면 안된다고 한다.

내부 폰트 사용하는 부분을 찾아서 다른걸로 교체하자.

 

 

[출처] lhh3520.tistory.com/168

 

[Unity3D] Asset: 'Library/unity editor resources' 에러

유니티를 빌드 하다보면 아래같은 에러가 날 때가 있는데.. 갑자기 뜬금없이 나니까 당황스럽네요. 여기저기 찾아보니 해결방법은 Unity Font 중에 Arial 을 제외한 다른 폰트 를 쓰면 안됩니다. UI

lhh3520.tistory.com

 

반응형
Posted by blueasa
, |