Closed gregorgold closed 7 years ago
Hi! Is this the correct section in build.gradle of android module to put the line: compile project(':UnityProject') ?
dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile project(path: "CordovaLib", configuration: "debug") releaseCompile project(path: "CordovaLib", configuration: "release") // SUB-PROJECT DEPENDENCIES END compile project(':UnityProject') } Cause android studio yields me the error: Gradle sync failed: Configuration with name 'default' not found. Thank you in advance
@sofiasalder Yes it should be there. Can you show us your settings.gradle (Project Settings) file ?
@gregorgold You can also do it without writing anything. You have to:
After the sync the line "compile project (':UnityProject')" should be at the right place
Thank you both for your help. I will be testing @Frobei's method soon and then I'll probably update the relevant part of the guide with his solution to avoid any confusions the next time.
@Frobei I tryed with the steps that you suggested above to gregogold and it works! thanks!
I have tried @Frobei's solution today. It works but if you have a "Android SDK location should not contain whitespace, as this can cause problems with NDK tools." warning in your Android Studio, all changes in Module Settings are magically discarded unless you move your Android SDK folder to somewhere else, which is not very convenient. Thus, I'll be sticking with the current method. But I will add a screenshot to that part to make things more clear.
Hi yasirkula,
thank you! Your solution accompanied by the tutorial work like a charm for me!
Just one thing you could maybe explain more clear in your tutorial:
"Open build.gradle of android module and insert the following line into dependencies, where all the other compile command(s) are located at:"
This step in the Android section is perfectly clear if you changed any gradle files before. I myself did it the first time ;) So I opened the file and put the "compile ..." line into the dependencies section I saw at first glance. But this is a sub-section of the "buildscript" section. Didn't work as could be expected than ;)
Maybe something like "into dependencies (section at top level, not a sub-set of other sections like buildscript)..." or so would help others to avoid that mistake and keep them from searching google for the android studio error message ;)
Best regards Greg