android gradle build - run task before assembleRelease or assembleLive - android

Below is my build.gradle file for app.
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
android {
signingConfigs {
liveSigning {
keyAlias 'xxxxxxx'
keyPassword 'xxxxxx'
storeFile file('D:\\xxxxx\\xxxxxxx\\xxxxx\\xxxx.jks')
storePassword 'xxxxxxx'
}
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
useLibrary 'org.apache.http.legacy'
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [];
}
defaultConfig {
applicationId rootProject.ext.applicationId
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
multiDexEnabled true
resConfigs "en"
vectorDrawables.useSupportLibrary true
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.liveSigning
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
task ndkBuild(type: Exec) {
commandLine rootProject.ext.ndkPath, '-C', file('src/main').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
lintOptions {
abortOnError false
}
productFlavors {
live {
minSdkVersion rootProject.ext.minSdkVersion
applicationId rootProject.ext.applicationId
signingConfig signingConfigs.liveSigning
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
resConfigs "en"
}
}
flavorDimensions "default"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/gson-2.2.4.jar')
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile files('libs/cordova-5.jar')
compile files('libs/org.apache.commons.io.jar')
compile files('libs/httpmime-4.2.3.jar')
compile files('libs/jsoup-1.7.3.jar')
compile files('libs/activation.jar')
compile project(':libraries:EventBus')
compile project(':libraries:PDFViewCtrlTools')
compile project(':libraries:imageannotations')
compile project(':libraries:bottom-bar')
compile project(':libraries:tooltip')
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
compile files('libs/glide-3.6.1.jar')
//compile 'com.roughike:bottom-bar:2.2.0'
compile project(':libraries:k4l-video-trimmer')
compile 'com.android.support:multidex:1.0.1'
compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.0.1'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'me.relex:circleindicator:1.2.2'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'org.apache.commons:commons-collections4:4.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
Before I generate signed APK to upload for google play store , I want to execute command line code. And by using that command line program i want to do some pre release activity like disable logs of NDK, change url to live website and etc. So how can I execute it before assembleLive or assembleRelease ? I don't want to execute that command line code before "assembleDebug". I want to execute it only before "assembleLive or assembleRelease".

I added below code to my gradle file and it works like a charm.
task prelivetask (type: Exec) {
commandLine 'cmd','/C', 'start', 'change.cmd'
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleRelease' || task.name == 'assembleLive') {
task.dependsOn prelivetask
}
}

Related

"Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution" even after upgrading gms to:4.0.2'

I have searched a lot of posts about this issue and all of them apparently got resolved after upgrading to 'com.google.gms:google-services:4.0.2'from 3.3. However i am still getting the same error.
I need to use data binding for the project . Disabling it compiles the project, but i can't find a way around data binding
Any help would be appreciated
My project build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
flatDir {
dirs 'libs'
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
signingConfigs {
WalletAppSignConfig {
keyAlias '********'
keyPassword '********'
storeFile file('********')
storePassword '********'
}
}
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "********"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "RNS_MESSAGE_TAG", "\"payload\""
// Sample GCM ID
buildConfigField "String", "GCM_ID", "\"********\""
// Default location of the CMS-D
buildConfigField "String", "CMS_URL", "\"http://********/cms\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.WalletAppSignConfig
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
android{
dataBinding{
enabled=true;
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('********') {
transitive = true
}
compile '********'
compile('net.sf.flexjson:flexjson:3.2') {
transitive = true
}
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
//compile "android.arch.persistence.room:runtime:1.0.0-alpha4"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
//annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha4"
// compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.google.firebase:firebase-messaging:17.0.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
//compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
testCompile 'junit:junit:4.12'
}
android.applicationVariants.all { variant ->
task("_generate${variant.name}Javadoc", type: Javadoc) {
********
********
******** }
}
//apply plugin: 'realm-android'

Execution failed for task ':app:transformClassesWithInstantRunForClientDebug'

The error
My gradle file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.neenbedankt.android-apt'
dependencies {
compile project(':venuemap')
// compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
// compile "com.android.support:support-v4:$rootProject.supportLibraryVersion"
// compile "com.android.support:design:$rootProject.supportLibraryVersion"
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
// compile "com.google.android.gms:play-services:$rootProject.playServicesVersion"
compile "com.google.android.gms:play-services-location:$rootProject.playServicesVersion"
compile "com.google.android.gms:play-services-maps:$rootProject.playServicesVersion"
compile "com.google.android.gms:play-services-plus:$rootProject.playServicesVersion"
compile "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
compile "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
compile "com.squareup.okhttp3:okhttp:$rootProject.okhttpVersion"
compile "com.squareup.okhttp3:logging-interceptor:$rootProject.okhttpVersion"
compile 'com.google.maps.android:android-maps-utils:0.4.4'
// compile 'com.google.maps.android:android-maps-utils:0.4+'
// compile 'com.google.maps.android:android-maps-utils:0.5+'
compile 'net.hockeyapp.android:HockeySDK:4.1.1'
compile 'com.flurry.android:analytics:6.5.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0#aar'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'org.parceler:parceler-api:1.1.9'
compile 'com.github.jd-alexander:library:1.1.0'
compile 'com.android.support:multidex:1.0.0'
compile "com.google.firebase:firebase- core:$rootProject.playServicesVersion"
compile 'com.facebook.android:facebook-android-sdk:4.+'
// annotationProcessor 'org.parceler:parceler:1.1.9'
compile('com.crashlytics.sdk.android:answers:1.4.0#aar') {
transitive = true;
}
}
android {
def defaultApplicationId = "com.yamo.android"
def defaultVersionName = "1.1.7"
def buildNumber = "53" // increment when merging with master
def defaultVersionCode = Integer.parseInt(buildNumber)
def buildNumberSuffix = " (" + buildNumber + ")"
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
applicationId defaultApplicationId
versionCode defaultVersionCode
versionName defaultVersionName
vectorDrawables.useSupportLibrary = true
// multiDexEnabled true
}
signingConfigs {
debug {
storeFile rootProject.file("keystore/debug.keystore")
}
release {
storeFile rootProject.file("keystore/release.keystore")
storePassword "password"
keyAlias "locassa"
keyPassword "password"
}
}
buildTypes {
debug {
minifyEnabled true
useProguard false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
useProguard true
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
live {
versionName defaultVersionName + buildNumberSuffix
}
client {
versionName defaultVersionName + "-CLIENT" + buildNumberSuffix
applicationId defaultApplicationId
}
internal {
versionName defaultVersionName + "-INTERNAL" + buildNumberSuffix
applicationId defaultApplicationId + ".internal"
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
}
//apply from:
rootProject.file('config/checkstyle/checkstyle.gradle')
apply plugin: 'com.google.gms.google-services'
}
When building app, I have got this error.
I am using android studio 2.3.3.
CompileSdkVersion is 26 and buildToolsVersion is 26.0.2.
And my gradle version is 2.3.3.
I have been searching the solution about this problem for several days but I didn't find anything on google.
Please help me to resolve this error. Thanks a lot!
This is your Problem :
compile 'com.facebook.android:facebook-android-sdk:4.+'
Use this :
compile 'com.facebook.android:facebook-android-sdk:4.4.0'

Error:Execution failed for task ':app:transformClassesWithDexForPlayDebug'

**Error:Execution failed for task ':app:transformClassesWithDexForPlayDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list D:\Android_Project\prayer-times-android-master\app\build\intermediates\multi-dex\play\debug\maindexlist.txt --output D:\Android_Project\prayer-times-android-master\app\build\intermediates\transforms\dex\play\debug\folders\1000\1f\main D:\Android_Project\prayer-times-android-master\app\build\intermediates\transforms\jarMerging\play\debug\jars\1\1f\combined.jar}**
build.gradle(Module App)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' } //excludeInFDroid
}
dependencies {
//noinspection GradleDynamicVersion
classpath 'io.fabric.tools:gradle:+' //excludeInFDroid
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric' //excludeInFDroid
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
signingConfigs {
debugKey {
storeFile file('D:/TU-Cloud/Dokumente/Sonstiges/debug.keystore')
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
}
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.metinkale.prayer"
minSdkVersion 15
targetSdkVersion 25
signingConfig signingConfigs.debugKey
versionCode 189
versionName '3.6.5'
multiDexEnabled true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
dexOptions {
javaMaxHeapSize "2g"
preDexLibraries = true
}
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.debugKey
minifyEnabled false
zipAlignEnabled false
}
release {
debuggable false
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
productFlavors {
fdroid {
versionName = android.defaultConfig.versionName + " F-Droid"
}
play {
versionName = android.defaultConfig.versionName + " Play Store"
repositories {
maven { url 'https://maven.fabric.io/public' } //excludeInFDroid
}
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
playCompile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {//excludeInFDroid
transitive = true;//excludeInFDroid
} //excludeInFDroid
fdroidCompile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.1#aar') {
transitive = true
}
compile('com.mikepenz:aboutlibraries:5.8.5#aar') {
transitive = true
}
compile 'com.vanniktech:vntnumberpickerpreference:1.0.0'
compile 'com.android.support:percent:25.2.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'joda-time:joda-time:2.9.6:no-tzdb'
compile 'com.koushikdutta.ion:ion:2.1.9'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'net.steamcrafted:materialiconlib:1.1.1'
compile 'com.android.support:customtabs:25.2.0'
compile 'com.evernote:android-job:1.1.3'
compile 'com.github.anrwatchdog:anrwatchdog:1.3.0'
playCompile 'com.google.android.gms:play-services-maps:10.2.1' //excludeInFDroid
playCompile 'com.google.android.gms:play-services-gcm:10.2.1' //excludeInFDroid
playCompile 'com.google.android.gms:play-services-location:10.2.1' //excludeInFDroid
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
}

Android jack and jill get stuck

I am trying to use Jack-Jill and Java8 for my Android app. Everything is good on my laptop but when I tried to run the project on CircleCI it's getting stuck on
transformClassesWithPreJackPackagedLibrariesForDebug
Here is my build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply from: 'test-environment.gradle'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
mavenCentral()
}
allprojects {
repositories {
jcenter()
}
}
android {
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false // true by default
checkAllWarnings false
checkReleaseBuilds false
ignoreWarnings true // false by default
quiet true // false by default
}
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "com.projectname.android"
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
versionCode 1
versionName "1.0"
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
ndk{
abiFilters "armeabi-v7a"
}
jackOptions {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
packagingOptions {
exclude 'com/androidquery/util/web_image.html'
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
exclude 'META-INF/LICENSE'
}
configurations {
all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}
if (System.getenv("CIRCLE")) {
defaultConfig {
versionCode Integer.parseInt(System.getenv("CIRCLE_BUILD_NUM"))
versionName "1.0.30"
}
} else {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
signingConfigs {
debug {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
staging {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
release {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
}
buildTypes {
debug {
ext.betaDistributionNotifications = false
signingConfig signingConfigs.debug
applicationIdSuffix ".dev"
minifyEnabled false
shrinkResources false
debuggable true
proguardFile 'proguard-release.cfg'
testProguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".dev"]
}
staging {
ext.betaDistributionEmailsFilePath = "staging_distribution_emails.txt"
ext.betaDistributionReleaseNotesFilePath = "release_notes.txt"
signingConfig signingConfigs.staging
applicationIdSuffix ".staging"
shrinkResources false
minifyEnabled true
jniDebuggable false
zipAlignEnabled true
proguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".staging"]
}
release {
signingConfig signingConfigs.release
shrinkResources false
minifyEnabled true
zipAlignEnabled true
jniDebuggable false
proguardFile 'proguard-release.cfg'
}
}
sourceSets {
main {
jniLibs.srcDirs 'src/main/libs'
jni.srcDirs = []
}
}
// productFlavors {
// all32 { minSdkVersion 15 }
// all64 { minSdkVersion 21 }
// }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':libraries:Instagram')
compile project(':libraries:librestreaming')
compile 'com.android.support:appcompat-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:cardview-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:design:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v13:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v4:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:percent:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.google.android.gms:play-services-location:' + project.GMS_VERSION
compile 'com.google.android.gms:play-services-gcm:' + project.GMS_VERSION
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android:flexbox:0.2.3'
compile group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.1.0'
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.4.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.facebook.device.yearclass:yearclass:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'hanks.xyz:smallbang-library:0.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.3#aar') {
transitive = true;
}
compile "com.mixpanel.android:mixpanel-android:4.+"
compile('com.yalantis:ucrop:2.2.0') {
exclude group: 'com.android.support', module: 'appcompat'
}
compile 'com.roughike:bottom-bar:2.0.2'
compile 'com.github.kenglxn.QRGen:android:2.2.0'
compile group: 'com.pubnub', name: 'pubnub', version: '4.0.11'
compile ('io.branch.sdk.android:library:2.+') {
exclude module: 'answers-shim'
}
// dagger2
compile 'com.google.dagger:dagger:2.4'
annotationProcessor 'com.google.dagger:dagger-compiler:2.4'
provided 'javax.annotation:jsr250-api:1.0'
// butterknife
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile('com.twitter.sdk.android:twitter:2.0.0#aar') {
transitive = true;
}
}
I use tool build gradle version 2.3.0-alpha1
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is some of what it shows in the log console:
:app:fabricGenerateResourcesDebug:app:fabricGenerateResourcesDebug
> Building 75%:app:generateDebugResources
> Building 75% > :app:mergeDebugResources:app:mergeDebugResources
> Building 75%> Building 76% > :app:processDebugResources:app:processDebugResources
> Building 76%:app:generateDebugSources
> Building 76% > :app:transformClassesWithPreJackPackagedLibrariesForDebug:app:transformClassesWithPreJackPackagedLibrariesForDebug
> Building 76%:app:processDebugJavaRes UP-TO-DATE
> Building 77% > :app:transformResourcesWithMergeJavaResForDebug:app:transformResourcesWithMergeJavaResForDebug
> Building 77% > :app:transformJackWithJackForDebug
Seems that it's stuck like forever when it tried to do something with transformJackWithJackForDebug on 77% of building process and then it reached the build time limit (I set it as 60 mins )
Has anyone faced this problem before? Please suggest.

2 app icons after installing the release apk,using gradle build

I am using ./gradlew assembleRelease command to generate release apk for the app.On installing the app I am getting 2 icons of app.No clue what am I missing.No luch on google.
On clicking the second icon it just shows Simple Indeterminate.
Here is my build.gradle file:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion '20.0.0'
defaultConfig {
versionCode 23
versionName "1.1.8.5"
applicationId "com.squad.run"
minSdkVersion 10
targetSdkVersion 20
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
signingConfigs {
//Set debug.keystore file here
release {
def propsFile = rootProject.file('keystore.properties')
def Properties props = new Properties()
props.load(new FileInputStream(propsFile))
storeFile = file(props['storeFile'])
storePassword = props['storePassword']
keyAlias = props['keyAlias']
keyPassword = props['keyPassword']
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
ext.enableCrashlytics = false
}
release {
zipAlign true
signingConfig signingConfigs.release
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
// compile 'com.android.support:support-v4:20.0.0'
compile project(':Libraries:viewPagerIndicator_Squadrun')
compile project(':Libraries:facebookSDK')
compile project(':Libraries:library')
compile project(':Libraries:progressHUD_Squadrun')
compile project(':Libraries:slidingMenuLibrary_SquadRun')
compile project(':Libraries:MobihelpSDK')
compile 'com.squareup.retrofit:retrofit:1.5.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'org.apache.httpcomponents:httpmime:4.2.3'
compile 'com.squareup.okhttp:okhttp:1.6.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
compile 'oauth.signpost:signpost-commonshttp4:1.2.1.2'
compile 'org.twitter4j:twitter4j-core:4.0.1'
compile files('libs/FlurryAnalytics-4.1.0.jar')
compile 'com.crashlytics.android:crashlytics:1.0.0'
}
My top guess is that there is more than one LAUNCHER activity, and that one of them is declared in a library project. Eclipse didn't merge the manifests, but Gradle does.
So, I would suggest you search for android.intent.action.MAIN in all AndroidManifest.xml files.

Categories

Resources