旧 Unity 版本:2018.1.6f1
新 Unity 版本:2019 版本
我正在开发一个统一的 android 项目,一切正常。我最近从 2019 的最新统一版本生成了导出,但它不起作用。我在 android 中得到ResourceNotFound异常。如果从旧的统一版本生成,则相同的导出工作。
我曾尝试升级 android studio,但似乎没有帮助。是否需要在 Android Studio 中进行任何更改以使其与最新的统一版本导出一起使用?或者在生成导出时是否需要在 Unity 中进行任何更改?
我附上了以下日志:
--------- beginning of crash
05-16 09:30:06.465 4495-4495/com.mytest.package E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mytest.package, PID: 4495
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 2018.3.14f1
Device model : EPSON EMBT3C
Device fingerprint: MOVERIO/embt3c/cht_cr_rvp:5.1.1/R1.4.0/H75607131158:user/release-keys
Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mytest.package/com.mytest.package.activity.UnityPlayerActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:299)
at android.content.res.Resources.getString(Resources.java:385)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer.<init>(Unknown Source)
at com.mytest.package.activity.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:38)
at android.app.Activity.performCreate(Activity.java:5994)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-16 09:30:06.776 4495-4495/com.mytest.package I/Process: Sending signal. PID: 4495 SIG: 9