Error:Execution failed for task
':app:transformClassesWithAndroidGradleClassShrinkerForDebug'.
Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.
How do i fix this?
PS- also I want to use progaurd in my application.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
dexOptions{
javaMaxHeapSize="2g"
}
defaultConfig {
applicationId "com.example.projetinnovation.newadvocatediary"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled=true
}
buildTypes {
debug {
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-andr oid.txt'),
'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android. txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
google()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':agendacalendarview')
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.8.+'
compile 'com.github.clans:fab:1.6.4'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.github.d-max:spots-dialog:0.7#aar'
compile 'com.github.ganfra:material-spinner:2.0.0'
compile 'com.android.support:multidex:1.+'
}
apply plugin: 'com.google.gms.google-services'
You need to add -dontwarn or -ignorewarnings to all third-party libraryes in proguard-rules.pro You can find description on docs/wiki pages of them
Related
I was adding Appbrain Sdk for Ads to my app gradle
compile 'com.appbrain:appbrain-sdk:14.30'
Now I'm getting this error:
Error:The number of method references in a .dex file cannot exceed 64K.
I followed the instruction by adding multiDexEnabled true to my code and I get OutOfMemoryException
Here is my code
my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.webstore.footballscores"
minSdkVersion 17
targetSdkVersion 26
versionCode 8
versionName "1.7"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.google.android.gms:play-services-ads:15.0.1'
compile 'com.facebook.android:audience-network-sdk:4.23.0'
compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.google.firebase:firebase-iid:16.0.0'
compile 'com.google.firebase:firebase-messaging:17.0.0'
compile 'com.google.android.gms:play-services-analytics:16.0.0'
compile 'com.google.android.gms:play-services-tagmanager:16.0.0'
compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.startapp:inapp-sdk:3.9.3'
compile 'com.appbrain:appbrain-sdk:14.30'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck=true
Add this code block to your build.gradle in android block.
dexOptions {
javaMaxHeapSize "4g"
}
instead of
dexOptions {
jumboMode true
}
This should solve your problem. Good luck.
When I'm trying to put apply plugin: 'com.google.gms.google-services' at the bottom of my build gradle or anywhere else inside my apps build gradle I get a error say it can't find it.
Error:(70, 0) Plugin with id 'com.google.gms.google-services' not found.
Here's my gradle code so you guy's can help me figure out where to place it.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
applicationId "com.technologx.blaze.player"
minSdkVersion 16
targetSdkVersion 24
versionCode 101
versionName "1.0 beta 1"
//renderscript support mode is not supported for 21+ with gradle version 2.0
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
ext.enableCrashlytics = false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:palette-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:percent:24.2.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'net.steamcrafted:materialiconlib:1.0.3'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.google.code.gson:gson:2.3'
compile 'de.Maxr1998:track-selector-lib:1.1'
compile 'com.afollestad.material-dialogs:core:0.9.0.2'
compile 'com.afollestad.material-dialogs:commons:0.9.0.2'
compile 'com.anjlab.android.iab.v3:library:1.0.+'
compile('com.github.naman14:app-theme-engine:0.5.2#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
I think you also need this in your projects gradle file:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
I am trying to integrate firebase into my android app, but I am receiving this error:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrs.class
This is my app level build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.evan.scout"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.instabug.library:instabug:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
I do not even see a zzrs.class file
Thanks
try this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.instabug.library:instabug:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
exclude group: 'com.google.android.gms'
}
I get and error when I try to Sync project with Gradles files
Here is the error
Error:Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'ua.com.qascript.android'
And here is the Gradle file content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
packagingOptions {
exclude('META-INF/NOTICE')
}
packagingOptions {
exclude('META-INF/LICENSE')
}
defaultConfig {
applicationId "ua.com.qascript.android"
minSdkVersion 14
targetSdkVersion 22
versionName '1.7'
versionCode 11
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/volley.jar')
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.android.support:design:24.2.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Well, this error appear after I update the Google Play Services to can add Firebase Cloud Messages, it request minimum vers 9.0.
Please help me to fix it. Thanks.
I am trying to compile my code on android studio and I am stuck at this point. I don't have any thing to compile using the ndk but everytime the compilation fails with this error.
When I check the workspace.xml it contains ExternalTaskPojo for compileDebugNdk and compileReleaseNdk.
I don't need them but can't figure out a way to remove them as it is an auto generated file.
Please suggest.
Edit -> build.gradle file
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':e')
compile 'com.android.support:support-v4:19.1.0'
}
Another build.gradle file
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':facebookSDK')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':volley')
compile project(':e')
compile project(':volley')
compile project(':f')
compile project(':g')
compile project(':h')
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/AF-Android-SDK-v1.3.16.0.jar')
compile files('libs/lib1')
compile files('libs/lib2')
compile files('libs/lib3')
compile files('libs/lib4')
compile files('libs/FlurryAgent.jar')
compile files('libs/renderscript-v8.jar')
compile files('libs/lib5')
}
After sometime I was able to fix my problem. I disabled the ndk-build by adding below property in the build.gradle file.
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build call
}