f111fei / react-native-unity-view

Show an unity view in react native
MIT License
402 stars 102 forks source link

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

Open bobanminic96 opened 3 years ago

bobanminic96 commented 3 years ago

Hi everyone,

I've got this error when trying to run-android project.

Any ideas?

build.gradle of UnityExport :

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

allprojects { buildscript { repositories { google() jcenter() }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0'

    }
}

repositories {
    google()
    jcenter()
    flatDir {
        dirs "${project(':unityLibrary').projectDir}/libs"
    }
}

}

task clean(type: Delete) { delete rootProject.buildDir }

I guess this could be related to settings.gradle in export so im providing you that one too.

include ':launcher',':unityLibrary'

agh372 commented 3 years ago

I got the same error! Did you fix it?

dmitry-markevich commented 3 years ago

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)

ti-hardikshah commented 3 years ago

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)

Where do i need to copy past this code ?

johnsonpeixoto commented 2 years ago

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)

Where do i need to copy past this code ?

In file android/UnityExport/build.gradle

komalharmale commented 2 years ago

Hi everyone,

I've got this error when trying to run-android project.

  • Where: Build file 'C:\xxxx\Project\ProjectName\android\UnityExport\build.gradle' line: 20
  • What went wrong: A problem occurred evaluating project ':UnityExport'.

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

Any ideas?

build.gradle of UnityExport :

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

allprojects { buildscript { repositories { google() jcenter() }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0'

    }
}

repositories {
    google()
    jcenter()
    flatDir {
        dirs "${project(':unityLibrary').projectDir}/libs"
    }
}

}

task clean(type: Delete) { delete rootProject.buildDir }

I guess this could be related to settings.gradle in export so im providing you that one too.

include ':launcher',':unityLibrary'

did you find any solution on this

komalharmale commented 2 years ago

A problem occurred evaluating project ':UnityExport'.

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

I am facing the same issue .did anyone have solution on this issue

TeeRa0ne commented 2 years ago

Hi, When i change :UnityLibrary by :UnityExport i've go this error : > What went wrong: Execution failed for task ':UnityExport:BuildIl2CppTask'.

A problem occurred starting process 'command '/Users/xxxxx/Desktop/xxxx/xxxx-react-native-cli/app/android/UnityExport/src/main/Il2CppOutputProject/IL2CPP/build/deploy/netcoreapp3.1/il2cpp.exe''`

Do you have a solution ?

komalharmale commented 2 years ago

Hi, When i change :UnityLibrary by :UnityExport i've go this error : > What went wrong: Execution failed for task ':UnityExport:BuildIl2CppTask'.

A problem occurred starting process 'command '/Users/xxxxx/Desktop/xxxx/xxxx-react-native-cli/app/android/UnityExport/src/main/Il2CppOutputProject/IL2CPP/build/deploy/netcoreapp3.1/il2cpp.exe''`

Do you have a solution ?

Hey did you find any solution on this?

twentectf commented 1 year ago

Hi everyone,

I've got this error when trying to run-android project.

  • Where: Build file 'C:\xxxx\Project\ProjectName\android\UnityExport\build.gradle' line: 20
  • What went wrong: A problem occurred evaluating project ':UnityExport'.

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

Any ideas?

build.gradle of UnityExport :

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

allprojects { buildscript { repositories { google() jcenter() }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0'

    }
}

repositories {
    google()
    jcenter()
    flatDir {
        dirs "${project(':unityLibrary').projectDir}/libs"
    }
}

}

task clean(type: Delete) { delete rootProject.buildDir }

I guess this could be related to settings.gradle in export so im providing you that one too.

include ':launcher',':unityLibrary'

Hi, did you find any solution?