Closed dibenedetto closed 1 year ago
[UPDATE] See my newer answer in the comments below.
The rest of this comment is outdated.
[Original comment] You will likely need to edit your gradle files to include this file. I haven't tested this yet, but it will probably be something like this:
android/settings.gradle
include ":xrmanifest.androidlib"
project(":xrmanifest.androidlib").projectDir = file("./unityLibrary/xrmanifest.androidlib")
android/app/build.gradle
dependencies {
+ implementation project(':xrmanifest.androidlib')
}
You will likely need to edit your gradle files to include this file. I haven't tested this yet, but it will probably be something like this:
android/settings.gradle
include ":xrmanifest.androidlib" project(":xrmanifest.androidlib").projectDir = file("./unityLibrary/xrmanifest.androidlib")
android/app/build.gradle
dependencies { + implementation project(':xrmanifest.androidlib') }
thanks, but it fails with the same error :(
Did you find a solution ? I have the same issue.
me too T_T
I'm not sure this is a solution to make the build is successful. But when I make same with @timbotimbo said, also comment out this line "implementation project('xrmanifest.androidlib')" in unityLibrary/build.gradle ==> flutter run is OK.
But, when run android device, I got below:
This is log on my console:
This is how I'm using the widget in Flutter:
Hope anybody can help
Just made a project to test this out.
Apparenty xrmanifest.androidlib
is a new folder and not a file like I expected, located in /unityLibrary
.
Adding a line to android/settings.gradle
made it compile again for me.
include ":unityLibrary"
project(":unityLibrary").projectDir = file("./unityLibrary")
+ include ':unityLibrary:xrmanifest.androidlib'
I got this from /unity/<project folder>/Builds/settings.gradle
which was generated by Unity. The builds folder is the original build created on an export and parts of that get moved to android/unityLibrary for this plugin.
While testing this ARFoundation ran into issue #836, the error with mUnityplayer
in @khangpt's screenshot above.
This means it is likely broken (for now) starting with the Unity versions:
include ':unityLibrary:xrmanifest.androidlib'
this, combined with that, apparently solved the problem: the application is built and it runs on the device, but the AR camera is not open and this error comes out:
E/Unity ( 596): AndroidJavaException: java.lang.NoSuchFieldError: no "Ljava/lang/Object;" field "mUnityPlayer" in class "Lcom/hyperversexr/hyperversexr/MainActivity;" or its superclasses
E/Unity ( 596): java.lang.NoSuchFieldError: no "Ljava/lang/Object;" field "mUnityPlayer" in class "Lcom/hyperversexr/hyperversexr/MainActivity;" or its superclasses
E/Unity ( 596): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
E/Unity ( 596): at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0)
E/Unity ( 596): at com.unity3d.player.UnityPlayer$C$a.handleMessage(Unknown Source:122)
E/Unity ( 596): at android.os.Handler.dispatchMessage(Handler.java:102)
E/Unity ( 596): at android.os.Looper.loop(Looper.java:233)
E/Unity ( 596): at com.unity3d.player.UnityPlayer$C.run(Unknown Source:24)
E/Unity ( 596): at UnityEngine.AndroidJNISafe.CheckException () [0x00091] in \home\bokken\build\output\unity\unity\Modules\AndroidJNI\AndroidJNISafe.cs:24
E/Unity ( 596): at UnityEngine.AndroidJNISafe.GetFieldID (System.IntPtr clazz, System.String name, System.String sig) [0x0000e] in \home\bokken\build\output\unity\unity\Modules\AndroidJNI\AndroidJNISafe.
is that related to the original issue?
That is a different breaking change in Unity, the last section with mUnityplayer
I mentioned above.
That is a different breaking change in Unity, the last section with
mUnityplayer
I mentioned above.
oh, that's ok, so i'll close this issue, thanks so much.
That is a different breaking change in Unity, the last section with
mUnityplayer
I mentioned above.
anyway, on my device, using version 2022.2.21f1 i can see the 3d scene (just a cube) but on a black background, e.g., no camera feedback.
with version 2022.2.0f1 it fails to build.
any idea on that?
That is a different breaking change in Unity, the last section with
mUnityplayer
I mentioned above.anyway, on my device, using version 2022.2.21f1 i can see the 3d scene (just a cube) but on a black background, e.g., no camera feedback.
with version 2022.2.0f1 it fails to build.
any idea on that?
I think you should try to enable camera permission on your device first. Hope this help
Any one have any solutions to this?
Describe the bug Build fails with error: "Project with path 'xrmanifest.androidlib' could not be found in project ':unityLibrary'".
To Reproduce Steps to reproduce the behavior: Include a Unity project which uses the XR management 4.4.0.
Expected behavior Successful build and run.
Screenshots No screenshot needed.
Unity (please complete the following information):
Smartphone (please complete the following information): It fails on build.
Additional context No additional info.