将 Vufoira 场景导入本机 android 应用
Importing Vufoira Scene into native android app
我正在开发使用 unity + vufoira 制作的 AR 应用程序,我想将它嵌入到本机 android 应用程序中。我使用此程序嵌入了我的应用 Embedding Unity In Android App 。但我一直有以下错误。
03-04 07:22:24.160 12649-13939/yenettaapp.beblocky E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source)
at com.unity3d.player.UnityPlayer$c.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/yenettaapp.beblocky-1/base.apk", zip file "/data/app/yenettaapp.beblocky-1/split_lib_dependencies_apk.apk", zip file "/data/app/yenettaapp.beblocky-1/split_lib_slice_0_apk.apk", zip file "/data/app/
03-04 07:22:24.205 12649-13939/yenettaapp.beblocky E/Unity: Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source)
at com.unity3d.player.UnityPlayer$c.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/yenettaapp.beblocky-1/base.apk", zip file "/data/app/ye
03-04 07:22:24.229 12649-14048/yenettaapp.beblocky E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in :0
at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in :0
03-04 07:22:24.229 12649-14048/yenettaapp.beblocky E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in :0
at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in :0
如何解决这个错误?
我也试过 Medium 的 Embedding Unity In Android App 教程,但没有成功。
试试这个 Unity3d tutorial -Export Unity Project to Android Studio。
- 首先在 Unity Build Settings 中,确保为 Build System、Export Project、Development Build 和 Script Debugging 选择 Gradle。
- 此外,请确保在 Android Studio 中更改 Gradle 依赖项版本。
这里是来自 Quora 的a similar question。
我遇到了同样的问题。我就是这样修复它的:
- 在项目 build.gradle 中,我在所有项目存储库下添加了这个:
flatDir {
dirs 'libs'
}
- 在我的模块 build.gradle 中,我添加了依赖项:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'VuforiaWrapper', ext:'aar'
希望对您有所帮助
我正在开发使用 unity + vufoira 制作的 AR 应用程序,我想将它嵌入到本机 android 应用程序中。我使用此程序嵌入了我的应用 Embedding Unity In Android App 。但我一直有以下错误。
03-04 07:22:24.160 12649-13939/yenettaapp.beblocky E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:400) at java.lang.Class.forName(Class.java:326) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.c(Unknown Source) at com.unity3d.player.UnityPlayer$c.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:154) at com.unity3d.player.UnityPlayer$c.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/yenettaapp.beblocky-1/base.apk", zip file "/data/app/yenettaapp.beblocky-1/split_lib_dependencies_apk.apk", zip file "/data/app/yenettaapp.beblocky-1/split_lib_slice_0_apk.apk", zip file "/data/app/ 03-04 07:22:24.205 12649-13939/yenettaapp.beblocky E/Unity: Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:400) at java.lang.Class.forName(Class.java:326) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.c(Unknown Source) at com.unity3d.player.UnityPlayer$c.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:154) at com.unity3d.player.UnityPlayer$c.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/yenettaapp.beblocky-1/base.apk", zip file "/data/app/ye 03-04 07:22:24.229 12649-14048/yenettaapp.beblocky E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in :0 at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in :0 03-04 07:22:24.229 12649-14048/yenettaapp.beblocky E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in :0 at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in :0
如何解决这个错误?
我也试过 Medium 的 Embedding Unity In Android App 教程,但没有成功。
试试这个 Unity3d tutorial -Export Unity Project to Android Studio。
- 首先在 Unity Build Settings 中,确保为 Build System、Export Project、Development Build 和 Script Debugging 选择 Gradle。
- 此外,请确保在 Android Studio 中更改 Gradle 依赖项版本。
这里是来自 Quora 的a similar question。
我遇到了同样的问题。我就是这样修复它的:
- 在项目 build.gradle 中,我在所有项目存储库下添加了这个:
flatDir { dirs 'libs' }
- 在我的模块 build.gradle 中,我添加了依赖项:
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation(name: 'VuforiaWrapper', ext:'aar'
希望对您有所帮助