gpt4 book ai didi

android - com.google.android.gms.internal.zzhu : can't find referenced class android. security.NetworkSecurityPolicy

转载 作者:IT老高 更新时间:2023-10-28 22:25:59 26 4
gpt4 key购买 nike

我尝试使用 proguard 生成 apk,但在尝试构建时出现此错误:

Warning: com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy

Warning: there were 3 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions. 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)
:app:proguardRelease FAILED
Error:Execution failed for task ':app:proguardRelease'.
java.io.IOException: Please correct the above warnings first.

最近,我升级了我的 Android SDK 工具。在此之前,这个项目对 proguard 没有任何问题。我发现了这篇文章 (https://plus.google.com/+PaulBurke/posts/T3vmAnRP3q6),Oliver Renner 写道:

"So basically the next Google library that may not be upgraded to the latest version. It also seems to require compileSdk 23 in order to be able to use ProGuard without modifications (Warning: com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy)"*

我更新了我的项目以使用 SDK 23 进行编译,但问题没有解决。

下面,我包含了我的 build.gradle 文件的一些部分:

compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
applicationId "com.sample.sample"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}

.
.
.

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:design:23.0.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.0@aar') {
transitive = true;
}
}

最佳答案

我遇到了同样的问题。警告消息说:

If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options.

让我们接受它的建议:

-dontwarn com.google.android.gms.internal.zzhu

对我来说,这解决了问题。但是,如果由于某种原因你的代码在没有类的情况下不能正常工作,你可以另外做这样的事情(未经测试):

-keep class com.google.android.gms.internal.** { *; }

请注意,无论哪种方式,您都需要 -dontwarn 行。祝你好运!

关于android - com.google.android.gms.internal.zzhu : can't find referenced class android. security.NetworkSecurityPolicy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32974025/

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