Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem occurred evaluating project ':flutter_unity_widget'. #6

Closed
jiangheng90 opened this issue May 18, 2019 · 22 comments
Closed

A problem occurred evaluating project ':flutter_unity_widget'. #6

jiangheng90 opened this issue May 18, 2019 · 22 comments

Comments

@jiangheng90
Copy link

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\Users\ShuWeiIT-JIangheng\Desktop\flutter_unity_app\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\SRC\flutter\.pub-cache\hosted\pub.flutter-io.cn\flutter_unity_widget-0.1.3+3\android\build.gradle' line: 37

* What went wrong:
A problem occurred evaluating project ':flutter_unity_widget'.
> Project with path ':UnityExport' could not be found in project ':flutter_unity_widget'.

* 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 0s
  Command: C:\Users\ShuWeiIT-JIangheng\Desktop\flutter_unity_app\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

When I finish config project and run it,this problem comes out。I dont know how to handle it

@lorant-csonka
Copy link

  • Make sure that you have the built unity project at the android/UnityExport/lib folder
  • Make sure that you replaced the dependencies with the good ones in build.gradle of flutter_unity_widget and at the UnityExport module
  • Make sure that you have removed the enableSplit options from build.gradle at UnityExport

If you need additional help, just watch this guide, it should be helpful: https://www.youtube.com/watch?v=exNPmv_7--Q

@juicycleff
Copy link
Owner

@jiangheng90 that is correct, you omitted that step

@andreibosco
Copy link

Try adding the following lines to the end of android/settings.gradle:

include ":UnityExport"
project(":UnityExport").projectDir = file("./UnityExport")

They exist in the example project settings.gradle file but not when creating from scratch using the unity script.

@ceciliamzayek
Copy link

I am having the same error.

When I downloaded the repo and did it within the example folder, it worked. But then I tried to make my own folder and use the package within my project I am getting this error. I' followed the ReadMe and the video. @lorant-csonka-planorama what do you mean by: Make sure that you have the built unity project at the android/UnityExport/lib folder?

The other two points I did for sure.

@juicycleff
Copy link
Owner

Please follow the tutorial in the readme

@RK21898
Copy link

RK21898 commented Dec 18, 2019

I am having this issue in December, 2019. I have followed the tutorial as well as this issue. After adding the following lines to the end of android/settings.gradle:

include ":UnityExport"
project(":UnityExport").projectDir = file("./UnityExport")

I received this error, thus making me to believe that part of the issue had been resolved.

ProcessException: Process "C:\Users\rowan\Desktop\MoveVisual\MoveVisual_ME\movevisualme\android\gradlew.bat" exited abnormally:

> Configure project :app
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/profile, src/profile/nullnull, src/nullnull, src/profile, src/nullnullProfile]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)


FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-0.1.6+5\android\build.gradle' line: 39

* What went wrong:
A problem occurred evaluating project ':flutter_unity_widget'.
> Project with path ':unity-classes' could not be found in project ':flutter_unity_widget'.

* 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 1s
  Command: C:\Users\rowan\Desktop\MoveVisual\MoveVisual_ME\movevisualme\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

Other than the built unity project in android/UnityExport/lib folder as I'm not sure whether to place it there because the tutorial states to do something completely different, I've followed all the steps correctly and have attempted it twice.

The supplied tutorial video is massively outdated and offers completely nothing that could help me.

Adding the following lines to the end of `android/settings.gradle in an attempt to fix the previous error, results in a different error.

include ":unity-classes"
project(":unity-classes").projectDir = file("./unity-classes")
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find :unity-classes:.
     Required by:
         project :app

* 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 1s
Gradle task assembleDebug failed with exit code 1

@lorant-csonka-planorama could you please supply an up-to-date fix for this issue with flutter_unity_widget: ^0.1.6+5? I am fairly new and can't even get my head wrapped around this completely, let alone solve the problem.

@SachinGanesh
Copy link

Make sure that you have added ':unity-classes' to settings.gradle
Screenshot 2019-12-18 at 9 49 15 PM

@RK21898
Copy link

RK21898 commented Dec 19, 2019

Make sure that you have added ':unity-classes' to settings.gradle
Screenshot 2019-12-18 at 9 49 15 PM

I have tried this just now, and it still says it can't find unity-classes

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find :unity-classes:.
     Required by:
         project :app

* 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
Gradle task assembleDebug failed with exit code 1

I have no clue what could be causing this, as it exists in the project.

image

@AmbrocioIsaias2808
Copy link

AmbrocioIsaias2808 commented Jan 9, 2020

So, whats the resolution?, i´m having the same issue and i can´t get a workaround, i have already made this changes, i had watched the video (and i agree with the past comments, the video is outdated) and no luck. Please, if you can update the repo solving this issue and make better video explaining detaily the steps.

image

@AmbrocioIsaias2808
Copy link

And well, i know that i´m doing someting wrong but anyway, opening the android folder generated by flutter in android studio and applying the mention changes (and adding some lines) i overpassed the error and now i have this.

In the alone android project it incounter this errors:

image

And when i try to run it with flutter it says:

image

@thomas-stockx
Copy link
Collaborator

Hi @AmbrocioIsaias2808,

The error you're seeing is quite self-explanatory. It states "Could not resolve project :unity-classes".
As you can see in your project structure, you have several modules (app, flutter_uity_widget, UnityExport, and VuforiaWrapper), but you do not have the unity-classes module.

You can use Android Studio's "import jar/aar" feature for this. Just point it at the unity-classes jar and it should generate the module for you (and adjust your gradle files).

@AmbrocioIsaias2808
Copy link

AmbrocioIsaias2808 commented Jan 10, 2020

Oh, ok i see, i have seen my mistake, i finally get it running, thanks a lot.

@luisfmcosta
Copy link

Hi.
I'm getting the following error when I try to build the release APK.
When I debug it works fine.

bug_build_apk

@DanFaceira
Copy link

same for me and others, i hope this gets fixed soon, cause right now means i cannot release an app

@burkard
Copy link

burkard commented Feb 28, 2020

Any update on the :UnityExport issue?

I'm having the same error as @luisfmcosta and @DanFaceira , only when building the release version... no problem with the debug one...

@luisfmcosta
Copy link

For Android, I managed to solve the problem by opening the Android project in Android Studio and then generating the signed APK there. For iOS, following the instructions in #93.

@OGmetamonkey
Copy link

I am having this issue in December, 2019. I have followed the tutorial as well as this issue. After adding the following lines to the end of android/settings.gradle:

include ":UnityExport"
project(":UnityExport").projectDir = file("./UnityExport")

I received this error, thus making me to believe that part of the issue had been resolved.

ProcessException: Process "C:\Users\rowan\Desktop\MoveVisual\MoveVisual_ME\movevisualme\android\gradlew.bat" exited abnormally:

> Configure project :app
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/profile, src/profile/nullnull, src/nullnull, src/profile, src/nullnullProfile]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)


FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-0.1.6+5\android\build.gradle' line: 39

* What went wrong:
A problem occurred evaluating project ':flutter_unity_widget'.
> Project with path ':unity-classes' could not be found in project ':flutter_unity_widget'.

* 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 1s
  Command: C:\Users\rowan\Desktop\MoveVisual\MoveVisual_ME\movevisualme\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

Other than the built unity project in android/UnityExport/lib folder as I'm not sure whether to place it there because the tutorial states to do something completely different, I've followed all the steps correctly and have attempted it twice.

The supplied tutorial video is massively outdated and offers completely nothing that could help me.

Adding the following lines to the end of `android/settings.gradle in an attempt to fix the previous error, results in a different error.

include ":unity-classes"
project(":unity-classes").projectDir = file("./unity-classes")
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find :unity-classes:.
     Required by:
         project :app

* 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 1s
Gradle task assembleDebug failed with exit code 1

@lorant-csonka-planorama could you please supply an up-to-date fix for this issue with flutter_unity_widget: ^0.1.6+5? I am fairly new and can't even get my head wrapped around this completely, let alone solve the problem.

@RK21898 Check the following two issues:

  1. As @SachinGanesh suggested, add :unity-classes to settings.gradle in your android directory of the flutter project.
    image

  2. It's easy to import the unity-classes module to the flutter root project directory rather than the android directory. Check to be sure your imported unity-classes library is in the android directory, and if not move it there and allow android studio to update paths when doing so.

@TinyGiantDigital
Copy link

@jbrantl8 adding the :unity-classes definitely helped but i'm still struggling with this too.

I can see the unity-classes module in my android folder but it is still complaining, can you see if anything in this screenshot looks wrong? I'm new to android studio so struggling with the process.
Screenshot 2020-05-09 at 10 01 27

@TinyGiantDigital
Copy link

I got to the bottom of this! I had to import the .lib file using: (File → New Module → Import .JAR/.AAR Package) and NOT by right clicking and adding as a module as was shown in the video tutorial.

@gneL1
Copy link

gneL1 commented Aug 12, 2020

I got to the bottom of this! I had to import the .lib file using: (File → New Module → Import .JAR/.AAR Package) and NOT by right clicking and adding as a module as was shown in the video tutorial.

cool!! only your answer solve my question.

@mo-futa
Copy link

mo-futa commented Jul 24, 2021

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\Users\ShuWeiIT-JIangheng\Desktop\flutter_unity_app\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\SRC\flutter\.pub-cache\hosted\pub.flutter-io.cn\flutter_unity_widget-0.1.3+3\android\build.gradle' line: 37

* What went wrong:
A problem occurred evaluating project ':flutter_unity_widget'.
> Project with path ':UnityExport' could not be found in project ':flutter_unity_widget'.

* 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 0s
  Command: C:\Users\ShuWeiIT-JIangheng\Desktop\flutter_unity_app\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

When I finish config project and run it,this problem comes out。I dont know how to handle it

i had the exact same problem
i fixed it by going into android studio, follow all the instruction on the pub.dev and then add a colon to

"implementation project('unity-classes')"
to make it
"implementation project(':unity-classes')"

and maybe comment out this
"implementation(name: 'unity-classes', ext:'jar')"

@SantosVision
Copy link

does anybody have this working on 2022? lol... evrything is outdated and tried everything i saw here... no luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests