gpt4 book ai didi

Android Studio 无法解析 getDefaultProguardFile

转载 作者:太空狗 更新时间:2023-10-29 15:52:26 25 4
gpt4 key购买 nike

当我运行我的程序时,我没有遇到任何问题。当我尝试生成签名的 apk 时,我被告知无法解析 getDefaultProguardFile。我怎样才能解决这个问题。这是代码。

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')
}

这是被询问的堆栈跟踪

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

最佳答案

我遇到了同样的问题。请注意,在日志中,他们指向您转到 http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember上面写着:

If you're developing for Android and ProGuard complains that it can't find a method that is only available in a recent version of the Android run-time, you should change the build target in your project.properties file or build.gradle file to that recent version. You can still specify a different minSdkVersion and a different targetSdkVersion in your AndroidManifest.xml file.

我将 compileSdkVersiontargetSdkVersion 从 21 更改为 22,它起作用了。

关于Android Studio 无法解析 getDefaultProguardFile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29159728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com