IanPhilips / UnityOculusAndroidVRBrowser

3D browser based on GeckoView and Oculus SDK for Unity projects built on Android (Oculus Go/Quest, maybe GearVR)
MIT License
225 stars 63 forks source link

How to build geckoViewPlugin in android studio #39

Closed rick2909 closed 2 years ago

rick2909 commented 3 years ago

When building via the rebuild option i get

Execution failed for task ':app:externalNativeBuildCleanDebug'.
> A problem occurred starting process 'command '/Users/ianphilips/Library/Android/sdk/cmake/3.6.4111459/bin/cmake''

so to build the .aar file i use gradlew assemble

after building it and renaming the 'app-release.aar' to the old name (is the necessary?) I get the following error;

Note: C:\Unity Projects\UnityOculusAndroidVRBrowser\UnityProject\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.eyeflite.ian.geckoviewplugin.BuildConfig found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.BytesBuffer found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$1 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$10 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$11 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$12 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$13 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$14 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$15 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$16 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$17 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$18 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$2 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$3 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$4 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$5 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$6 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$7 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$8 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$9 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin$SessionTypes found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.OVRSurfaceGeckoView found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.OVRSurfaceGeckoView$1 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.OVRSurfaceGeckoView$2 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.OVRSurfaceGeckoView$3 found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.OVRSurfaceGeckoView$Display found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)
  Duplicate class com.eyeflite.ian.geckoviewplugin.UnityInterface found in modules classes.jar (:app-debug:) and classes.jar (:geckoview-armeabi-v7a-80.0.20200818235255:)

  Go to the documentation to learn how to Fix dependency resolution errors.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

UnityEngine.GUIUtility:ProcessEvent (int,intptr)
IanPhilips commented 3 years ago

I've never seen that error before unfortunately, but your built library comes out as app-release.aar? It should come out as app-debug.aar so that could be a clue. I just use the little green hammer in Android Studio. The out is at: build/outputs/aar/app-debug.aar Screen Shot 2021-11-07 at 8 04 27 PM

rick2909 commented 3 years ago

yes that is build is made, what do I need to do with it. now I'm renaming it to geckoview-armeabi-v7a-80.0.20200818235255 in the folder ./UnityProject/Assets/Plugin/Android/

IanPhilips commented 3 years ago

just leave the name as it is and replace the app-debug.aar in UnityOculusAndroidVRBrowser/UnityProject/Assets/Plugin/Android/ with your newly built .aar

IanPhilips commented 3 years ago

The geckoview-armeabi-v7a-80.0.20200818235255 is the name of the underlying geckoview library from Mozilla that we use to create the Unity plugin. Unity uses app-debug.aar

IanPhilips commented 2 years ago

closing due to inactivity - feel free to reopen