Issue
I am new to Android development and trying to setup Jenkins to automate build generation on my mac machine. When I run the Jenkins build it is not generating any apk at jenkins workspace. I am gradle wrapper and 'gradlew assembleDebug' command but it give error that " 'assembleDebug' Task not found in root project". I tried 'gradlew tasks' to view all available tasks and it does not list any android specific tasks.
When I open the same project using Android Studio, it listed all tasks properly (including assembleDebug).
What could be potential issue! is it Android sdk path or gradle plugin in Jenkins environment causing this.
Any help is greatly appreciated.
Solution
change your module Gradle to this
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.tarunsmac.moviesapp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
and try
Answered By - sanemars