libgdx gdx-setup.jar Build failed - java

I have problem with resolving dependencies. Have you guys had similar issue? Any ideas?
thanks in advance
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'test'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find org.robovm:robovm-gradle-plugin:1.0.0-SNAPSHOT.
Searched in the following locations:
_https://repo1.maven.org/maven2/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/maven-metadata.xml
_https://repo1.maven.org/maven2/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/robovm-gradle-plugin-1.0.0-SNAPSHOT.pom
_https://repo1.maven.org/maven2/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/robovm-gradle-plugin-1.0.0-SNAPSHOT.jar
_https://jcenter.bintray.com/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/maven-metadata.xml
_https://jcenter.bintray.com/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/robovm-gradle-plugin-1.0.0-SNAPSHOT.pom
_https://jcenter.bintray.com/org/robovm/robovm-gradle-plugin/1.0.0-SNAPSHOT/robovm-gradle-plugin-1.0.0-SNAPSHOT.jar
Required by: :test:unspecified
(I've added underscore in links to get it posted in here.)
it works when I uncheck iOS subproject... Have no idea how to fix it

I had the same problem when using a libGDX project with libGDX version 1.5.4.
In your build.gradle file look for something like:
classpath 'org.robovm:robovm-gradle-plugin:1.0.0-SNAPSHOT' and change it to: classpath 'org.robovm:robovm-gradle-plugin:1.0.0-beta-04'
Do the same for: roboVMVersion = '1.0.0-SNAPSHOT' and change it to: roboVMVersion = '1.0.0-beta-04'
This should work otherwise try changing both to: 1.0.0-beta-01.
After this it should ask you to sync your project, click sync now!
Hope this helps!
Here are some helpful links:
https://github.com/robovm/robovm-gradle-plugin#robovm-gradle-plugin
http://libgdx.badlogicgames.com/news.html

For those who are using the latest version of Android Studio 4.0.0, if your Generate fails in libGDX it says
FAILURE: Build failed with an exception.
Don't worry you need to downgrade Gradle version to 6.0 by dragging the file you created in libGDX into Android Studio, then going to Gradle Script> gradle-wrapper.properties
And change
distributionUrl = https : //services.gradle.org/distributions/gradle-6.3-zip.zip
change into
distributionUrl = https : //services.gradle.org/distributions/gradle-6.0-all.zip
Please note you will also need to install java jdk 8!
This worked for me, I had to spend a lot of time including uninstalling Android Studio but it didn't work at all. From above experience is how I got it solved very quickly and inexpensively!

Related

Android Studio: Could not find com.android.tools.build:gradle:3.6.2 during import an Eclipse project

I'm trying to build this project https://github.com/vocollapse/Blockinger with Android Studio by importing it, because I suppose it was an Eclipse project earlier.
After import, it gives me the following message:
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:3.6.2.
I was finding solutions for this trouble, but found nothing that might help. Could someone suggest me how to fix this error and open/build this project correctly? I'm new in Android development and may not understand some specific details
The problem was solved with the following steps:
1. Add google() to buildscript -> repositories
2. Set distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip in gradle-wrapper.properties

Gradle version not supported after Android Studio update

I am running on Windows 10.
I just updated the Android studio to 3.6, and my app is no longer syncing. I'm getting 3 separate responses for the failure
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.android.internal.version-check']
Caused by: java.lang.RuntimeException: Minimum supported Gradle version is 5.6.4. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\redacted\redacted\Documents\Android Studio\app\gradle\wrapper\gradle-wrapper.properties to gradle-5.6.4-all.zip
ERROR: Minimum supported Gradle version is 5.6.4. Current version is 5.4.1.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project (Appears as an un-clickable link for me)
Open Gradle wrapper properties (Appears as an un-clickable link for me)
Gradle settings (Appears as an un-clickable link for me)*
Being smart as I am, I checked my gradle-wrapper properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
In the project structure, the Gradle version is also correct, 5.6.4.
I have uninstalled and reinstalled Android Studio.
I have also tried running the program on a different machine.
I created a brand new (working!) project to compare the gradle-wrapper properties file and everything matches.
Please help me out if you can.
Update as to how I resolved the situation. I started a brand new project, and copied over all the Kotlin and XML code. I'm still not sure what went wrong.
I renamed the project directory and re-imported the project, and it worked. Then I changed it back to the old name and it continued working. Magic!
P.S.
BTW I also deleted all the .iml files .idea .gradle files gradle gradlew gradlew.bat files also.
Yes, it just ignores what is in gradle-wrapper.properties. After a week of frustration and trying dozens of different solutions that didn't solve it...
Create a new 3.6.1 dummy project and Gradle Sync to force download of the new Gradle distribution.
Then in File -> Settings -> Gradle, set Use Gradle from to Specified location and set the full path of where your gradle is (e.g. C:\Users\Duncan\.gradle\wrapper\dists\gradle-5.6.4-all\ankdp27end7byghfw1q2sw75f\gradle-5.6.4). And finally it works again!
Then you can delete the new dummy project.
Why is Android Studio / Gradle so ridiculously overcomplicated and unreliable ? Every upgrade is a nightmare.
I followed the advice of these awesome Flutter error messages and simply replaced in my project's file <project>/android/gradle/wrapper/gradle-wrapper.properties the line distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip by distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip (thereby only changing the version of the employed gradle module).
That solved the issue.
Just upgrade (Increase) the build.gradle version

Execution failed for task ':app:javaCompileDebug'

I recently went back to an app in android studio that worked fine on Android Studio 2.3.3 but this morning when I was prompted to update to Studio 3.0 my module wont make. I have tried cleaning and rebuilding but when I try run it on my device the build fails and gives me this error:
Error:Execution failed for task ':app:javaPreCompileDebug'.
Annotation processors must be explicitly declared now. The following
dependencies on the compile classpath are found to contain annotation
processor. Please add them to the annotationProcessor configuration.
- androidannotations-4.0.0.jar (org.androidannotations:androidannotations:4.0.0)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
I have no clue about android annotations that is why I am asking here on SO.
Thanks!
After doing some research I was able to find this GitHub issue. This picture solved my problem!

libgdx first time user.Error in runnable 'Creating Gradle model'

So, I create a new project with libgdx (for desktop,android,iOS,html and at extensions,I got set Box2d.
I generate the project,all seems to be ok, but when I import the project in eclipse, it gives me this error:
Error title: Error in runnable 'Creating Gradle model'
Error message: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 See error log for details.
Anyone has any idea about this?
Once again ,I specify -it's my first time using this and I followed the documentation steps ,from libgdx's website. ( http://libgdx.badlogicgames.com/documentation.html )
I just had this exact problem you're having, and I found the solution elsewhere on this site:
Error at building model of new Gradle project for libgdx
It seems there's a current incompatibility between the latest release version of Eclipse (4.4.1) and the latest release version of the Gradle Eclipse plugin (3.6.1). This problem is reportedly fixed in the 3.6.2 development build of the Gradle plugin, so you could install the development build if you wanted, but being a development build who knows what else might be broken in it.
I opted for the solution outlined in the other question here, which was to add the following lines to the end of the eclipse.ini file for your Eclipse install:
-Dosgi.configuration.area.default=null
-Dosgi.user.area.default=null
-Dosgi.user.area=#user.dir
After I did this and restarted Eclipse, I was able to import my Gradle project.
Same problem happened with me,Here is how i resolve.
first of all it's quite easy.
[Follow 3 steps]
step 1: just connect to the internet and then click on build model.
step 2: It will start downloading a zip file.
step 3: After that restart eclipse.
enjoy coding...
:)
Create file local.properties in project's folder (one that you are trying to import)
in that file enter this:
sdk.dir=C:/path to my android/sdk
Then try to Build Model again.
It worked for me.

Using Gradle in Android Development

Im new to android development and ive seen some old tutorials before regarding its development on Eclipse. i recently download the new Android Studio to use for the development. However, i found something new called gradle files that are present in the projects folder along with the normal files that used to be in the project.
Everytime i try to run the app i get the following error:
"
Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assemble' not found in root project 'SampleProject'.
* Try:
Run gradle tasks to get a list of available tasks.
"
Could anyone please explain whats the use of gradle? and do i have to use it while developing android apps?
Thank you
Version 0.2.1 of Studio was just released and provides a better error. You should upgrade and see what happens, but it's likely that your project has another problem that should be fixed instead of randomly adding a task that shouldn't be added.
In your top directory file with name build.gradle just put:
task assemble {}
You can see it in known issues here
Get started with gradle here!
Edit: Android Studio 0.2.1 solves this error: http://tools.android.com/recent/androidstudio021released
Android Studio is bleeding edge (not yet beta).
For more stable solution use Eclipse with ADT, e.g. ADT-bundle http://developer.android.com/sdk/index.html
You can develop in Eclipse with ADT and run Gradle build using Nodeclipse/Enide Gradle for Eclipse
(marketplace)
Some screenshots for Gradle for Eclipse:

Categories