通过Proguard(Android)发布输出失败

时间:2015-07-16 06:26:36

标签: android android-proguard

我的应用程序在重复数据删除模式下正确运行,没有问题。 但是当尝试发布应用程序时,请遵守以下警告:

  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 linkthis 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\""

    }

}

这是我的错误或发生了其他事件!?

1 个答案:

答案 0 :(得分:5)

将它放入你的proguard文件-dontwarn android.support.v4。**