筆者の開発環境
- Windows 10
- Unity2020.3.23
- Nreal Devkit(2022年4月購入。メガネはNreal Lightコンシューマー版と同じ)
- Computing Unit(Android端末)は Android 8.1.0
- NRSDK v1.8.0
- 2022/8/9 追記:NRSDK 1.9.3 では Development Build で実機起動できるようになった
症状
- NRSDK Demo の HelloMR がビルド対象
- Unity の Build Settings の「Development Build」をONにして apk を作成
- Nreal実機にて apk を実行すると、以下エラーで起動できない
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2020.3.23f1 (c5d91304a876)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
Build fingerprint: 'Nreal/sdm845/sdm845:8.1.0//test-keys'
Revision: '0'
ABI: 'arm'
Timestamp: 2022-05-05 20:31:33+0900
pid: 3422, tid: 3440, name: UnityMain >>> com.DefaultCompany.NRTest2 <<<
uid: 10069
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 00000d70 r2 00000006 r3 00000008
r4 00000d5e r5 00000d70 r6 d21fe23c r7 0000010c
r8 00000000 r9 00000ca8 r10 d21fe29c r11 00000000
ip bbf1c220 sp d21fe228 lr f07b97a7 pc f07b3764
backtrace:
#00 pc 0001a764 /system/lib/libc.so (abort+64) (BuildId: 3449788fd4d0b66ac4d5c0fe96fb7d9e)
#01 pc 0035ffaf /system/lib/libart.so (art::Runtime::Abort(char const*)+262) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#02 pc 0041ee2f /system/lib/libart.so (std::__1::function<void (char const*)>::operator()(char const*) const+26) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#03 pc 0041ed5b /system/lib/libart.so (android::base::LogMessage::~LogMessage()+426) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#04 pc 0024ed11 /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1232) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#05 pc 0024ee93 /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+58) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#06 pc 000d6799 /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+48) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#07 pc 000db781 /system/lib/libart.so (art::ScopedCheck::CheckStaticFieldID(art::ScopedObjectAccess&, _jclass*, _jfieldID*)+104) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#08 pc 000db24b /system/lib/libart.so (art::ScopedCheck::CheckFieldAccess(art::ScopedObjectAccess&, _jobject*, _jfieldID*, bool, art::Primitive::Type)+34) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#09 pc 000dac81 /system/lib/libart.so (art::CheckJNI::GetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type)+564) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#10 pc 000cc169 /system/lib/libart.so (art::CheckJNI::GetStaticIntField(_JNIEnv*, _jclass*, _jfieldID*)+36) (BuildId: 62f284d32a99a02003b02deb0d1ed696)
#11 pc 000fe365 /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#12 pc 000f4115 /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#13 pc 000d857f /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#14 pc 000d91a1 /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#15 pc 000e42a5 /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#16 pc 0009cd55 /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#17 pc 0009d34b /data/app/com.DefaultCompany.NRTest2-YMFlloXd_i2qxwf9lBzJ-Q==/lib/arm/libnr_api.so (NRGlassesControlStart+322) (BuildId: deab11b3a65bcdbe9c921d5f6224136ec8bde9c6)
#18 pc 0000c3a6 <anonymous:e8e43000>
managed backtrace:
#00 (wrapper managed-to-native) NRKernal.NativeGlassesController/NativeApi:NRGlassesControlStart (ulong)
#01 NRKernal.NativeGlassesController:Start () <D:\Project\Unity\NRTest2\Assets\NRSDK\Scripts\Interfaces\Wrappers\NativeGlassesController.cs:96>
#02 NRKernal.NRDeviceSubsystem:Start () <D:\Project\Unity\NRTest2\Assets\NRSDK\Scripts\Subsystems\Device\NRDeviceSubsystem.cs:69>
#03 NRKernal.NRDevice:Init () <D:\Project\Unity\NRTest2\Assets\NRSDK\Scripts\Interfaces\NRDevice.cs:94>
#04 NRKernal.NRSessionManager:CreateSession (NRKernal.NRSessionBehaviour) <D:\Project\Unity\NRTest2\Assets\NRSDK\Scripts\Managers\NRSessionManager.cs:251>
#05 NRKernal.NRSessionBehaviour:Awake () <D:\Project\Unity\NRTest2\Assets\NRSDK\Scripts\NRSessionBehaviour.cs:48>
#06 (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
備考
- ちなみに、IL2CPPビルドはできた
- IL2CPP + DevelopmentBuild ON でも上記と同様のエラーだった
- Unityプロファイラなどは使えないが、DevelopmentBuild OFF で進める
- 実機で Unity Assert が無効になってしまうのが残念