I am successfully able to generate the debug apk of my Android app. But while generating a signed version I get the message:
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task
':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.
Following is the list of my project dependencies:
dependencies {
compile 'ch.acra:acra:4.5.0'
compile project(':androidHorizontalListView')
compile 'cz.msebera.android:httpclient:4.4.1.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.android.support:design:24.0.0'
compile 'com.github.danylovolokh:hashtag-helper:1.1.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
}
methodscount.com shows, that Acra (v 4.5.0) depends on:
org.json:json:20080701
You have two choices:
Update Acra to version 4.7.0
or
Add this dependency
Related
In my proyect I have this dependecies:
compile ('com.twitter.sdk.android:twitter:2.2.0#aar'){
transitive=true;
}
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.android.gms:play-services-auth:11.2.0'
compile 'com.itextpdf:itextg:5.5.10'
compile 'com.nightonke:boommenu:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
twitter and google are used to sign up a new user, but if I want to add facebook using com.facebook.android:facebook-android-sdk:[4,5) dependency, appears this error:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 70800 into a non-jumbo instruction!
I also notice that if I delete
compile 'com.itextpdf:itextg:5.5.10'
The error never appears, but I need that dependency!!
I found that this happends while there are too much strings or something like that, and It can be fixed by adding
dexOptions {
jumboMode = true
}
But the compile time increase!!
So, why that happend if facebook is independent of itext?
and how to fix that issue without delete something or adding dexOption or even without adding multidex option?
I am trying to incorporate Facebook SDK , but Android Studio is giving me errors at compile time.
Here is my error:
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 2
Gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/gcm.jar')
compile files('libs/httpmime-4.1.1.jar')
compile files('libs/junit-4.10.jar')
compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/signpost-jetty6-1.2.1.1.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile project(':stripe')
compile project(':FacebookSDK')
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.specyci:residemenu:1.6+'
compile 'com.android.support:multidex:1.0.0'
}
But this doesn't work, and honestly isn't a good solution. When I remove facebook sdk, my app compiles no problem, but with it nothing works. What am I missing here?
You are over 64K methods in your build because of using so many libraries, enable multiDex, clear unused libraries, remove unused methods with ProGuard or whatever you want, but you have reached the method count limit for a single APK.
I have changed the minifyEnabled to true in build.gradle file. Then i got the issue
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
dependencies
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/YouTubeAndroidPlayerApi.jar')
debugCompile project(path: ':djlibrary')
releaseCompile project(path: ':djlibrary')
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
There is some issue with proguard. Kindly help me with this to get it done
When using Firebase Authentication with compile 'com.google.firebase:firebase-auth:9.2.1' try adding the following flags to your proguard-rules.pro:
-keepattributes Signature
-keepattributes *Annotation*
Read more at Set up Firebase Authentication for Android.
For Firebase Realtime Database with compile 'com.google.firebase:firebase-database:9.2.1' you need to consider how your model objects will be serialized and deserialized after obfuscation. For details, read more at Set up Firebase Realtime Database for Android.
I am getting below error log:
Error:Execution failed for task
'app:transformClassesWithJarMergingForDebug'.>
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
android/support/annotation/Keep.class
Here is the list of build.gradle dependencies:
dependencies {
compile project(':chartboostSDK')
compile project(':flurry_lib')
compile project(':googleCloudMessaging_lib')
compile project(':mainLibProj')
compile project(':localytics_lib')
compile project(':mobihelp_sdk_android_v1534')
compile project(':unityandroidresources')
compile project(':iAB_lib')
compile project(':etcetera_lib')
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/FlurryPlugin.jar')
compile files('libs/FreshdeskPlugin.jar')
compile files('libs/Prime31UnityActivity.jar')
compile files('libs/adcolony-adapter-1.1.6.jar')
compile files('libs/android-bridge.jar')
compile files('libs/apsalar.jar')
compile files('libs/apsalarUnity3d.jar')
compile files('libs/bolts-android-1.2.1.jar')
compile files('libs/chartboost-adapter-1.0.6.jar')
compile files('libs/crittercism_v5_4_3_sdkonly.jar')
compile files('libs/dagger.jar')
compile files('libs/emojiplugin.jar')
compile files('libs/in-app-purchasing-2.0.61.jar')
compile files('libs/javax.inject.jar')
compile files('libs/mediationsdk-6.3.5.jar')
compile files('libs/nativex-adapter-1.0.3.jar')
compile files('libs/nineoldandroids.jar')
compile files('libs/support-annotations-23.1.1.jar')
compile files('libs/tapjoyconnectlibrary.jar')
compile files('libs/tapjoyunitywrapper.jar')
compile files('libs/unity-classes.jar')
compile files('libs/vungle-adapter-1.1.6.jar')
compile files('libs/unity-classes.jar')
}
Try to import the library as a gradle dependency like this:
compile 'com.android.support:support-annotations:23.1.1'
If you want to use jar then it seems like that it hasn't been properly built. So try to do something like this:
Unzip the jar file. (Simply change .jar extension to .zip
This will remove the duplicate files.
Recreate the jar using jar cf xmlbeans.jar -C (path to unzipped folder) . (Mind it, there is a dot in the end of command)
Use this regenerated jar
How to resolve this error while compiling google play service gcm and admob.
Error:Execution failed for task ':processDebugResources'.
Error: more than one library with package name 'com.google.android.gms'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0[enter image description here][1]
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.code.gson:gson:2.3'
compile "com.android.support:appcompat-v7:22.2.1"
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
This will probably vanish if you use the same version on both (7.8.0)
compile 'com.google.android.gms:play-services-gcm:7.8.0' // <- remove this line
compile 'com.google.android.gms:play-services:6.5.87'
There is already 8.1+ though.
Also:
Gcm is already in the play services, you can remove the whole line.