When I run my program i get no problems. When I try to generate signed apk, I am told that getDefaultProguardFile cannot be resolved. How can I fix this. Here is the code.
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.dose.apps.brainnoodles"
minSdkVersion 8
targetSdkVersion 21
versionCode 13
versionName "2.13"
}
buildTypes {
release {
//apply plugin: 'idea'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/InMobi-4.5.3.jar')
}
Here's the stacktrace that was asked
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'void setTraversalAfter(android.view.View,int)' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:android.support.v4.media.session.MediaSessionCompatApi22: can't find referenced method 'void setRatingType(int)' in library class android.media.session.MediaSession
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'android.view.accessibility.AccessibilityNodeInfo getTraversalBefore()' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:com.inmobi.commons.internal.ActivityRecognitionManager: can't find referenced class com.google.android.gms.common.GooglePlayServicesUtil
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'void setTraversalAfter(android.view.View)' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'android.view.accessibility.AccessibilityNodeInfo getTraversalAfter()' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'void setTraversalBefore(android.view.View)' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:android.support.v4.view.accessibility.AccessibilityNodeInfoCompatApi22: can't find referenced method 'void setTraversalBefore(android.view.View,int)' in library class android.view.accessibility.AccessibilityNodeInfo
Warning:com.inmobi.commons.internal.ActivityRecognitionManager$a: can't find referenced class com.google.android.gms.common.GooglePlayServicesUtil
You may need to add missing library jars or update their versions.
Warning:there were 6 unresolved references to classes or interfaces.
Warning:com.inmobi.commons.uid.a: can't find referenced class com.google.android.gms.common.GooglePlayServicesUtil
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning:there were 7 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED
Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
You might have to replace the buildtypes codepart with this
I had the same problem. Note that in the log they are pointing you to go to http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember and there it says:
I changed the
compileSdkVersion
&targetSdkVersion
from 21 to 22 and it worked.@That Thatson :
Just update your buildTypes instead your . Try this way.