react-native-unity-view icon indicating copy to clipboard operation
react-native-unity-view copied to clipboard

Project with path ':unityLibrary' could not be found in project ':UnityExport'.

Open agh372 opened this issue 4 years ago • 1 comments

When I'm trying to run yarn react-native run-android

Got the following error stack in terminal

FAILURE: Build failed with an exception.

* Where:

Build file '/Users/ReactNativeVuf/android/UnityExport/build.gradle' line: 92


* What went wrong:

A problem occurred configuring project ':UnityExport'.

> Project with path ':unityLibrary' could not be found in project ':UnityExport'.


 

* 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 2s


 

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

agh372 avatar Oct 11 '20 01:10 agh372

I do not know if this is correct, but this code fixed the problem and Unity works now inside RN:

afterEvaluate {
       if (project(':UnityExport').tasks.findByName('mergeDebugJniLibFolders'))
           project(':UnityExport').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
       if (project(':UnityExport').tasks.findByName('mergeReleaseJniLibFolders'))
           project(':UnityExport').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
    }

(replace :unityLibrary to :UnityExport)

dmitry-markevich avatar Nov 18 '20 12:11 dmitry-markevich