Android build fails in Jenkins - because of evaluating project: app - android

I am running the following gradle script in my Jenkins android job - ./gradlew app:connectedQADebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.size=large
And it always fails because of this problem What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.google.gms.google-services']
No such property: applicationVariants for class: java.lang.String
The same script works when I run from android studio on the same machine.
However when I run /gradlew app:connectedQADebugAndroidTest it works. Can anyone please help me understand and solve the problem? Thanks!

Related

Build failed : A problem occurred evaluating project ':#mauron85_react-native-background-geolocation-common'

FAILURE: Build failed with an exception.
Where:
Build file '/Users/User/Desktop/testApp/node_modules/#mauron85/react-native-background-geolocation/android/common/build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':#mauron85_react-native-background-geolocation-common'.
Failed to apply plugin 'com.android.internal.library'.
The option 'android.enableUnitTestBinaryResources' is deprecated.
The current default is 'false'.
It has been removed from the current version of the Android Gradle plugin.
The raw resource for unit test functionality is removed.
Steps for solution :-
Install patch-package, this will later be used to make the changes permanent. (optional - step)
Now you have to hack the node_modules. Go to node_modules#mauron85\react-native-
background-geolocation\android\common\gradle.properties change below things:-
android.enableUnitTestBinaryResources=true # <-- remove this line
android.builder.sdkDownload=true
Run npx patch-package #mauron85/react-native-background-geolocation to save the patch.
Rebuild the app.

ionic capacitor build android fail processDebugGoogleServices missing

I work with ionic. I successfully make and build an app to ios with capacitor, but when I run command ionic cordova build android it run 'Success Buid'.
But when I run app from Android Studio throw error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':capacitor-cordova-android-plugins:processDebugGoogleServices'.
> No matching client found for package name 'capacitor.android.plugins'
I put google-info.json to the app. Add line to app build.gradle and projek build.gradle.
Fixed for me by renaming package_name to : capacitor.android.plugins in google-services.json

Task 'assembleDevKernelDebug' not found in project ':app' - Android build using AppCenter

I have recently ejected my expo app using expo eject.
I have now tried to build using AppCenter, it gets about 4 minutes in and then fails with the following error message.
FAILURE: Build failed with an exception.
What went wrong: Task 'assembleDevKernelDebug' not found in project ':app'.
Can anyone point me in the right direction of how to fix this?
My android folder looks like this
My build.gradle looks like this

Jenkins build failed with crashlytics

Trying to build android in Jenkins with crashlytics but every-time the error message is coming in log as
"FAILURE: Build failed with an exception.
Where:
Build file
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'io.fabric']
Could not create plugin of type 'CrashlyticsPlugin'.
Could not initialize class com.crashlytics.tools.gradle.CrashlyticsPlugin"
Please help, tried this way also "Android Jenkins build fails with crashlytics"
It did not work.
You have to install Crashlytics jar manuel into Jenkins. From here.
I guess the plug-in is facing some problems when downloading this file from Amazon.
You can check here.

Execution failed for task ':app:mockableAndroidJar'

I am using local gradle of version 2.4 and IntelliJ IDEA 14.1.3
When I run project from IntelliJ it runs fine but when execute gradle clean build command from command line it gives the flowing exception and build fails.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mockableAndroidJar'.
> java.util.zip.ZipException: invalid entry compressed size (expected 2051 but got 2050 bytes)
This looks like an old ques which is not yet answered yet.
I got into same problem, when my jar files could not be read by Android Studio and it gave me the above mentioned error.
Taking lead from the comment by -Mikhail Boyarsky I changed classpath in build.gradle file to 'com.android.tools.build:gradle:2.2.3'.
Synced project and it started working.
I solved it by changing com.android.tools.build:gradle:2.3.0 version to 2.2.3, then build it with another exception and then I changed the version back to 2.3.0.
Not sure how it works, looks like a gradle bug.

Categories

Resources