react-native-unity
react-native-unity copied to clipboard
Make standalone android build with AR features. Getting error: Direct local .aar file dependencies are not supported when building an AAR.
I am integrating unity app with react android. Integration is successful by testing using development metro server. It's working fine as expected.
Now I am trying to make standalone debug build for testing but getting following errors. Anyone has idea how to fix and make successful standalone debug build?
Trying to make standalone debug build using this command: ./gradlew assembleDebug
> Error while evaluating property 'hasLocalAarDeps' of task ':unityLibrary:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :unityLibrary project caused this error: D:\Dhruv\react\unity6\react-native-unity-app-main-arr-six-cogno\unity\builds\android\unityLibrary\libs\IngameDebugConsole.aar, D:\Dhruv\react\unity6\react-native-unity-app-main-arr-six-cogno\unity\builds\android\unityLibrary\libs\arcore_client.aar, D:\Dhruv\react\unity6\react-native-unity-app-main-arr-six-cogno\unity\builds\android\unityLibrary\libs\UnityARCore.aar, D:\Dhruv\react\unity6\react-native-unity-app-main-arr-six-cogno\unity\builds\android\unityLibrary\libs\ARPresto.aar, D:\Dhruv\react\unity6\react-native-unity-app-main-arr-six-cogno\unity\builds\android\unityLibrary\libs\unityandroidpermissions.aar
@azesmway Let me know if you have any idea on above. Thanks
I had a similar issue trying to include 3 aar libraries. You can solve it like this.
You have file IngameDebugConsole.aar inside ./unity/builds/android/unityLibrary/libs/.
- Within the android directory, create a directory named IngameDebugConsole
- Move the IngameDebugConsole.aar from ./unity/builds/android/unityLibrary/libs/ to ./android/IngameDebugConsole
- Create a file,
build.gradleinside the./android/IngameDebugConsoleand type the following
configurations.maybeCreate("default")
artifacts.add("default", file('IngameDebugConsole.aar'))
- Modify the ./android/settings.gradle
+include ': IngameDebugConsole'
+project(": IngameDebugConsole").projectDir = file("./IngameDebugConsole")
include ':unityLibrary'
project(':unityLibrary').projectDir=new File('..\\unity\\builds\\android\\unityLibrary')
- Update ./unity/builds/android/unityLibrary/build.gradle
+implementation project(':IngameDebugConsole')
-implementation(name: 'IngameDebugConsole', ext:'aar')
You can do the same for as many libraries you want. This should resolve the error.