通过 Proguard 发布输出失败 (Android)
Fail in release output via Proguard (Android)
我的应用程序 运行 在 dedug 模式下正确,没有问题。
但是当尝试发布应用时遇到以下警告:
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: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: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 setTraversalAfter(android.view.View)' in library class android.view.accessibility.AccessibilityNodeInfo
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: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
FAILURE: Build failed with an exception.
在搜索中我发现 this link and this one。
所以,I changed the compileSdkVersion & targetSdkVersion from 21 to 22
但不起作用!
其他gradle 详情:
compileSdkVersion 21
buildToolsVersion "22.0.1"
minSdkVersion 15
targetSdkVersion 21
buildTypes {
debug {
buildConfigField "String", "key", "\"value\""
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard_file.txt')
buildConfigField "String", "key", "\"value\""
}
}
是我的失误还是发生了其他事情!?
把这个放在你的proguard文件中-dontwarn android.support.v4.**
我的应用程序 运行 在 dedug 模式下正确,没有问题。 但是当尝试发布应用时遇到以下警告:
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: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: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 setTraversalAfter(android.view.View)' in library class android.view.accessibility.AccessibilityNodeInfo
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: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
FAILURE: Build failed with an exception.
在搜索中我发现 this link and this one。
所以,I changed the compileSdkVersion & targetSdkVersion from 21 to 22
但不起作用!
其他gradle 详情:
compileSdkVersion 21
buildToolsVersion "22.0.1"
minSdkVersion 15
targetSdkVersion 21
buildTypes {
debug {
buildConfigField "String", "key", "\"value\""
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard_file.txt')
buildConfigField "String", "key", "\"value\""
}
}
是我的失误还是发生了其他事情!?
把这个放在你的proguard文件中-dontwarn android.support.v4.**