1

Gradle build running continuously, I have updated Android Studio with 3.0.1 with updated gradle plugin with all dependencies. Build Release version without Proguard is working fine. I'm not using crashlytics in code but firebase, it stuck here at these last lines. How to resolve this ?

:app:compileReleaseNdk NO-SOURCE
:app:compileReleaseSources UP-TO-DATE
:app:processReleaseJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:app:transformClassesAndResourcesWithProguardForRelease UP-TO-DATE
Inlining subroutines...
 Obfuscating...
 Printing mapping to [..outputs\mapping\release\mapping.txt]...
 Preverifying...
Writing output...
Preparing output jar [..intermediates\transforms\proguard\release\0.jar]
 Printing classes to [..outputs\mapping\release\dump.txt]...
:app:crashlyticsStoreDeobsRelease
:app:crashlyticsUploadDeobsRelease

Proguard rules

-keepattributes Signature
-keepattributes *Annotation*
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
 static final long serialVersionUID;
 private static final java.io.ObjectStreamField[] serialPersistentFields;
 !static !transient <fields>;
 private void writeObject(java.io.ObjectOutputStream);
 private void readObject(java.io.ObjectInputStream);
 java.lang.Object writeReplace();
 java.lang.Object readResolve();
 }

 -keep class com.onesignal.** { *; }

project gradle

buildscript {
repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'io.fabric.tools:gradle:1.25.1'
    classpath 'com.google.gms:google-services:3.1.1'
}
}
 allprojects {
repositories {
    jcenter()
    maven { url "https://maven.google.com" }
}
}

App Gradle

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.25.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.myproject"
    resConfigs "auto"


    minSdkVersion 16
    targetSdkVersion 24
    versionCode 2
    versionName "1.1"
}
buildTypes {
    release {
        debuggable true
        useProguard true
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable true
        minifyEnabled true
        useProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
useLibrary 'org.apache.http.legacy'
}

dependencies {
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.onesignal:OneSignal:3.7.1'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}

apply plugin: 'com.google.gms.google-services'

gradle properties

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -
XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Deepak
  • 29
  • 5
  • 1
    Mike from Crashlytics here. Try removing `minifyEnabled true` from your debug variant and see if that fixes it. – Mike Bonnell Feb 12 '18 at 13:11
  • Thanks for helping out but no luck. Removed from debug variant but same result in release variant ( Generate Signed APKs). Now I used shrinkResources false and minifyEnabled false , then without delay it successfully created. BUT i wan to use shrink and minify option in release version. – Deepak Feb 12 '18 at 14:07
  • your hint (minifyEnabled) landed me to this [link](https://github.com/firebase/quickstart-android/issues/75) , unfortunately same problem. – Deepak Feb 12 '18 at 14:30
  • @MikeBonnell ..Any way to disable uploading of deobs files to cm.crashlytics.com during build process ? – Deepak Feb 12 '18 at 18:20
  • minifyEnabled true is what we use to determine if a mapping file should be uploaded to cm. crashlytics.com. Given that the answer has a networking issue, I'd check to see if any proxies or firewalls are blocking or slowing down the traffic. – Mike Bonnell Feb 12 '18 at 18:58
  • Thanks @MikeBonnell for your time and help. but still wondering why it's uploading deobs files while i'm using only Firebase Auth not crashlytics. Any functional problem in app if i use "ext.enableCrashlytics = false" in release type ? – Deepak Feb 12 '18 at 19:11
  • 1
    The build.gradle references Fabric within it which is why the upload is happening. If you're not using Fabric in debug build, I'd recommend following the steps here: https://docs.fabric.io/android/crashlytics/build-tools.html#disable-crashlytics-for-debug-builds If you use ext.enableCrashlytics = false, then you may get an error if Fabric is still enabled at other points. – Mike Bonnell Feb 13 '18 at 01:31
  • @MikeBonnell, Hi, Is there a way to avoid uploading if gradle is in offline mode? In case that sometimes building a release apk in weak networks, it would be better:) – thecr0w Jul 16 '19 at 07:24
  • I'm not aware, but I'm no longer working on the product so my knowledge is out of date. – Mike Bonnell Jul 16 '19 at 13:42

1 Answers1

1

Accidentally I let it run for more than 1 hour then signed released build with

minifyEnabled true

was ready. I got below message after

:app:crashlyticsStoreDeobsRelease
:app:crashlyticsUploadDeobsRelease
 WARN - Crashlytics had a problem uploading the deobs file. Please check network connectivity and try again.
java.net.UnknownHostException: cm.crashlytics.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)

So what does it mean ? Whether you are using crashlytics code or not, it's uploading deobfuscated file to cm.crashlytics.com !!

Any way to disable this ..uploading deobfuscating files ?

EDIT: I used this in release build type and now within seconds signed release build is ready !!

ext.enableCrashlytics = false

src: How to disable Crashlytics while developing

Deepak
  • 29
  • 5