Jenkins build failed after updating gradle - android

I updated Gradle tools from 2.2.3 to 2.3.2. I don't have a problem to build a project on my local machine. However, Jenkins can't build the project. I've got following console output.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'workforce'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.3.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
Required by:
project :
> Could not find com.android.tools.build:gradle:2.3.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
Required by:
project : > com.jakewharton.hugo:hugo-plugin:1.2.1
> Could not find com.android.tools.build:gradle:2.3.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom
https://maven.fabric.io/public/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.jar
Required by:
project : > com.fernandocejas.frodo:frodo-plugin:0.8.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Do you have an idea, what's wrong?

As https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom that is mentioned in the error message is present and accessible, I guess your Jenkins does not have proper access to JCenter. Maybe some proxy that does not forward properly or something like that. Maybe it was a temporary hickup and if you try again it works. If not, maybe try to access this URL from your Jenkins worker via curl or wget to see whether the Jenkins host itself can access the URL.

Libraries update solved the problem.

Related

Get error message to use github Liquid Swipe package

I am going to use liquid swipe package for my android app. ( https://github.com/Cuberto/liquid-swipe-android ).
So I did every thing step by step according to the it's manual.
I have generated my account key and token from my github account and added gpr.user and gpr.key then added dependencies. but when I built my app I will get this error message.
"Username must not be null!"
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve com.cuberto:liquid-swipe:1.0.0.
Required by:
project :app
> Could not resolve com.cuberto:liquid-swipe:1.0.0.
> Could not get resource 'https://maven.pkg.github.com/Cuberto/liquid-swipe-android/com/cuberto/liquid-swipe/1.0.0/liquid-swipe-1.0.0.pom'.
> Username must not be null!
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.
my github.properties:
gpr.user = user
gpr.key = key
Best regards
https://api.github.com/users/<github username>
Run the above on your browser. This will return a json. In that json, you will see an id, that's your gpr user
For the token, go to developer setting in your github and create a token.
Note: Make sure to tick read packages

I get an error when trying to build android releases for my KorGe app with Gradle

I'm working on a rather simple game with Kotlin using KorGe. It works just fine on the JVM, but when I try to run an androidDebug/release it throws the following error:
Execution failed for task ':compileTestKotlinJvm'.
Error while evaluating property 'filteredArgumentsMap' of task ':compileTestKotlinJvm'
Could not resolve all files for configuration ':jvmTestCompileClasspath'.
> Could not resolve org.jetbrains.kotlin:kotlin-test:1.6.10.
Required by:
project :
> Unable to find a variant of org.jetbrains.kotlin:kotlin-test:1.6.10 providing the requested capability org.jetbrains.kotlin:kotlin-test-framework-junit:
- Variant compile provides org.jetbrains.kotlin:kotlin-test:1.6.10
- Variant runtime provides org.jetbrains.kotlin:kotlin-test:1.6.10
- Variant platform-compile provides org.jetbrains.kotlin:kotlin-test-derived-platform:1.6.10
- Variant platform-runtime provides org.jetbrains.kotlin:kotlin-test-derived-platform:1.6.10
- Variant enforced-platform-compile provides org.jetbrains.kotlin:kotlin-test-derived-enforced-platform:1.6.10
- Variant enforced-platform-runtime provides org.jetbrains.kotlin:kotlin-test-derived-enforced-platform:1.6.10
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.
I tried changing Kotlin version, SDK version, Gradle version...Nothin works!
Can someone help please ?

Jenkins - Execution failed for task ':app:mergeDebugResources'

I am trying to work with Jenkins however I cannot build the apk with it as I am having issue with AAPT2 and Gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-hdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-xhdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-mdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
I already read tons of SO question that may share same issue to my case saying that it has something to do with the file path being too long but I still cannot find any solution.
UPDATE
I tried to change Android Studio Gradle home similar to what Jenkins is using and received similar error which indicates that it may really have something to do with long file path.
I think the final question will be how to change Jenkins Gradle Home?
You need to replace \ with \\ if you are giving path with jenkins in Windows.
May be if file path is too huge or that is the root cause you can try mounting the directory to a short path
EDIT : Based on your modified question :
Open Jenkins dashboard. Navigate to Manage Jenkins-> Configure System. Under the Global properties section add another environment variable named GRADLE_USER_HOME as shown below.
I ran into this exact issue, but unfortunately changing the GRADLE_USER_HOME environment variable did not help, as aapt2 appeared to ignore the change and still used Windows/system32/... for the cache location.
The problem was how I was running Jenkins as a service. In the service.msc settings, it was set to Log On as a Local System account, which set the USER_HOME variables to C:\Windows\System32. Because of this, the reason the error said that the file did not exist was because Jenkins/gradle did not have access to the System32 folder.
My fix was to change the log on method to 'This account', then enter a user account so Jenkins wasn't logged on as system anymore.

react-native: project not building after running expo eject

I recently ejected my Expo project because I needed to install a native module. It built the first time after taking an incredible amount of time, then trying to build again and it keeps saying this:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:devMinSdkDevKernelDebugCompileClasspath'.
> Could not find host.exp.exponent:expoview:30.0.0.
Searched in the following locations:
file:/home/tushh/Android/Sdk/extras/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Android/Sdk/extras/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Android/Sdk/extras/google/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Android/Sdk/extras/google/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Android/Sdk/extras/android/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Android/Sdk/extras/android/m2repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/android/maven/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Documents/findworka/vapo-and/android/maven/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/node_modules/expokit/maven/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Documents/findworka/vapo-and/node_modules/expokit/maven/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/android/maven-test/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Documents/findworka/vapo-and/android/maven-test/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
https://maven.google.com/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
https://maven.google.com/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
https://jcenter.bintray.com/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
https://jcenter.bintray.com/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/home/node_modules/jsc-android/android/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/Documents/findworka/vapo-and/home/node_modules/jsc-android/android/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/android/app/libs/expoview-30.0.0.aar
file:/home/tushh/Documents/findworka/vapo-and/android/app/libs/expoview.aar
https://jitpack.io/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
https://jitpack.io/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
file:/home/tushh/.m2/repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
file:/home/tushh/.m2/repository/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
https://maven.fabric.io/public/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.pom
https://maven.fabric.io/public/host/exp/exponent/expoview/30.0.0/expoview-30.0.0.aar
Required by:
project :app
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
I've tried everything I can, and the issues on GitHub don't provide an explicit way to fix this
try this: ./gradlew devMinSdkDevKernelDebugCompileClasspath --refresh-dependencies
And if doesnt help. You can try ./gradlew clean and then go to the AndroidStudion open you project there and File -> Invalidate Caches / Reset => Invalidate and Reset and build it again

Error when installing FirebaseAuth.unitypackage, Gradle failed to fetch dependencies

I installed the google json to my project, and the FirebaseAuth.unitypackage, aswell. While the Firebase.Auth.unitypackage was being added the console displayed "Gradle failed to fetch dependencies". I updated my play services resolver to 1.2.50.00 by deleting the previous one and imported the new one into my project as another post said but no fix. I also tried /Assets/PlayServicesResolver/Resolve and Force resolve.
The console logs:
Gradle failed to fetch dependencies.
Failed to run 'Temp\PlayServicesResolverGradle\gradlew.bat -b Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle "-PANDROID_HOME=C:/Users/Augmented Marketing/Downloads/android-sdk_r24.4.1-windows/android-sdk-windows" "-PTARGET_DIR=C:\Users\Augmented Marketing\Documents\Unity firebase test\Assets\Plugins\Android" "-PMAVEN_REPOS=file:///C:/Users/Augmented Marketing/Documents/Unity firebase test/Assets/Firebase/m2repository" "-PPACKAGES_TO_COPY=com.google.android.gms:play-services-base:11.2.0;com.google.firebase:firebase-common:11.2.0;com.google.firebase:firebase-core:11.2.0;com.google.firebase:firebase-app-unity:4.1.0;com.google.firebase:firebase-auth:11.2.0;com.google.firebase:firebase-auth-unity:4.1.0"'
stdout:
BUILD FAILED
Total time: 1.315 secs
stderr:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Augmented Marketing\Documents\Unity firebase test\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle' line: 129
* What went wrong:
A problem occurred evaluating root project 'PlayServicesResolverGradle'.
> Illegal character in path at index 26: file:///C:/Users/Augmented Marketing/Documents/Unity firebase test/Assets/Firebase/m2repository
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
exit code: 1
UnityEngine.Debug:LogError(Object)
GooglePlayServices.PlayServicesResolver:<PlayServicesResolver>m__0(String, LogLevel)
Google.JarResolver.PlayServicesSupport:Log(String, LogLevel, Boolean)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__0(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey1:<>m__0()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Can you try change the folder name Unityfirebasetest instead of Unity firebase test and AugmentedMarketing instead of Augmented Marketing in C:\Users\Augmented Marketing\Documents\Unity firebase test ?
So, remove the blanks.
I believe the issue is whitespace in your project path. We fixed this in the 4.2.0 release of the Firebase SDK https://firebase.google.com/support/release-notes/unity#4.2.0 and in https://github.com/googlesamples/unity-jar-resolver/commit/bf515eb2080ee9713584684521d36ad7e8d62fbd of the Play Services Resolver.
Cheers,
Stewart

Categories

Resources