아이폰 빌드 jit , aot exceptions (linq)

Unity3D/Problems 2015. 7. 13. 14:54
반응형

아이폰 AP비교 

아이폰 4S : A5 (32bit) 960*640

아이폰 5  : A6 (32bit) 1136*640

아이폰 5C : A7 (64bit) 1136*640

아이폰 5S : A7 (64bit) 1136*640




모바일용 .NET Library의 크기 감소 

.NET2.0 , .NET 2.0 subset 

메모리 낭비를 막기위해 유니티에서 .NET2.0 subset을 지원함.

http://docs.unity3d.com/kr/current/Manual/ReducingFilesize.html



IL2CPP

iOS64비트를 지원하기위해 나온 Unity4.6 스크립팅 백엔드 기술을 IL2CPP라 함.

http://docs.unity3d.com/Manual/iphone-64bit.html





.NET2.0 subset과 IL2CPP 번역

https://saladaqoo.wordpress.com/2015/01/01/unity-5-0b-il2cpp/




iOS AOT compilation options 

Unity 에서 AOT 를 사용하여 IPhone 빌드를 할 경우 내부적으로 트렘폴린을 얼마나 사용할지를 지정한다.

이는 런타임 시에 사용할 Generic, Interface, Generic Method 등의 크기를 지정하는데,

컴파일 시에 이 크기를 계산하고 알아서 맞추어 줄 수도 있지만, 사용자가 지각하고 알아서 사용량을 수정 하거나 조절 할 수 있게 하기 위해 놔두는 것도 있다.


또한 이 트램플린의 경우 큰 사이즈로 조절하면 그만큼 실행 파일의 크기가 증가하며, 메모리 낭비가 될 수 있다.

( 다만 속도에는 영향을 미치지 않는다. )


우선 트램폴린의 종류에는 아래와 같이 3가지가 있다.


nrgctx-trampolines=8096 (these are recursive generics – the default is 1024)

nimt-trampolines=8096 (these are to do with interfaces and the default is 128)

ntrampolines=4048 (are to do with generic method calls, by default there are 1024)



각각의 트램폴린의 크기가 하는일은 위에서와같이 Generic, Interface, Generic Method Call 로 나누어지며

유니티에서 빌드 시 기본값이 주어져 있다.


이 값을 넘어서는 사용을 할 경우, 런타임에서 다음과 같은 경고와 함께 앱이 죽어버린다.

"Ran out of trampolines of type 0"

"Ran out of trampolines of type 1"

"Ran out of trampolines of type 2"


뒤에 붙는 타입은 각기 다르다.


tpye 0 의 경우 generic method calls ( ntrampolines )

tpye 1 의 경우 generics ( nrgctx-trampolines )

tpye 2 의 경우 interfaces ( nimt-trampolines )

이다.


해당하는 에러의 타입에 맞추에 해당 크기를 늘려주면 된다.




"Scripting Backend옵션과 Api Compatibility Level옵션에 대한 iOS 테스트 결과 

AOT Compilation Options 설정후 "Scripting Backend"를 Mono(2.x) , "Api Compatibility Level"를 .NET 2.0 으로 빌드시 에러 

(Cross compilation job Assembly-CSharp-firstpass.dll.failed.UnityEngine.UnityException: Failed AOT cross compiler...)


AOT Compilation Options 설정후 "Scripting Backend"를 Mono(2.x) , "Api Compatibility Level"를 .NET 2.0 subset 으로 빌드시 에러 

(Cross compilation job Assembly-CSharp-firstpass.dll.failed.UnityEngine.UnityException: Failed AOT cross compiler...)


AOT Compilation Options 설정후 "Scripting Backend"를 IL2CPP , "Api Compatibility Level"를 .NET 2.0 로 빌드시 성공 

AOT Compilation Options 설정후 "Scripting Backend"를 IL2CPP , "Api Compatibility Level"를 .NET 2.0 subset 으로 빌드시 성공 




xcode 빌드 테스트 결과 

다운로드 경로 : https://developer.apple.com/kr/xcode/downloads/


1. 기존 개발자계정이 있고 만기된 상태 였음.

2. Xcode 7.0 beta에서는 기기빌드가 무료라고 해서 다운받아 설치함 

3. provisioning profile가 없다고 경고함 

4. 무시 하고 빌드 하면 빌드 안댐.

5. 다시 껐다 키면 프로비저닝 파일 없이 빌드가 될때도 있음 

6. Linq에러 남 

7. AOT 컴파일 옵션을 재 설정후 다시 빌드 

8. "3"번 부터 반복...

9. 개발자 계정 구입 

10. XCode 6.3 빌드 성공 

11. Xcode 7.0 beta 빌드 성공.

12. 재현이 안됨..ㅠㅠ


반응형
: