gpt4 book ai didi

android-studio - Android Studio Gradle版本Build耗时无限

转载 作者:行者123 更新时间:2023-12-03 05:34:28 25 4
gpt4 key购买 nike

我最近将代码库更新为Androidx,现在尝试使用以下命令构建生产版本

> ./gradlew assembleProduction

它继续在流程上构建transformClassesAndResourcesWithProguardForProductionRelease

这是输出
Note: com.google.android.gms.measurement.internal.zzgp: can't find dynamically referenced class com.google.android.gms.tagmanager.TagManagerService
Note: com.google.android.gms.measurement.internal.zzs: can't find dynamically referenced class android.os.SystemProperties
Note: com.google.android.youtube.player.internal.aa: can't find dynamically referenced class com.google.android.youtube.api.locallylinked.LocallyLinkedFactory
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: io.fabric.sdk.android.FabricKitsFinder: can't find dynamically referenced class com.google.android.gms.ads.AdView
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE8PlatformImplementations
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE7PlatformImplementations
Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard$Companion: can't find dynamically referenced class dalvik.system.CloseGuard
Note: okhttp3.internal.platform.AndroidPlatform$Companion: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: okhttp3.internal.platform.AndroidPlatform$Companion: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl
Note: okhttp3.internal.platform.ConscryptPlatform$Companion: can't find dynamically referenced class org.conscrypt.Conscrypt$Version
Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: the configuration refers to the unknown field 'com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian mResultGuardian' in class 'com.google.android.gms.common.api.internal.BasePendingResult'
Note: the configuration refers to the unknown method 'com.android.vending.billing.IInAppBillingService asInterface(android.os.IBinder)' in class 'com.android.vending.billing.IInAppBillingService'
Note: the configuration refers to the unknown method 'com.google.android.gms.measurement.AppMeasurement getInstance(android.content.Context,java.lang.String,java.lang.String)' in class 'com.google.android.gms.measurement.AppMeasurement'
Note: the configuration explicitly specifies 'sun.misc.Unsafe' to keep library class 'sun.misc.Unsafe'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParser'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserException'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserFactory'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlSerializer'
Note: the configuration explicitly specifies 'android.widget.Space' to keep library class 'android.widget.Space'
Note: there were 7 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 3 references to unknown class members.
You should check your configuration for typos.
Note: there were 6 library classes explicitly being kept.
You don't need to keep library classes; they are already left unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#libraryclass)
Note: there were 49 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 1 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Ignoring unused library classes...
Original number of library classes: 24139
Final number of library classes: 2071
Printing kept classes, fields, and methods...
Inlining subroutines...
Shrinking...
Printing usage to [/Users/harsh/git/Mobile_Android_MVA/app/build/outputs/mapping/production/release/usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 21242
Final number of program classes: 21242
Optimizing (pass 1/5)...
<=<============-> 99% EXECUTING [14m 57s]
> :app:transformClassesAndResourcesWithProguardForProductionRelease

我的gradle.properties看起来像这样
> org.gradle.jvmargs=-Xmx3096m -XX:MaxPermSize=512m
> -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
>
> org.gradle.parallel=true org.gradle.daemon=true
> # Disables R8 for Android Library modules only. android.enableR8.libraries = false
> # Disables R8 for all modules. android.enableR8 = false android.useAndroidX=true android.enableJetifier=true
>
> org.gradle.configureondemand=true

我正在使用proguard并发布buildType有以下内容
minifyEnabled true
useProguard true
shrinkResources true
zipAlignEnabled true
debuggable false

我尝试使用和不使用androidx proguard但结果相同
-keep class androidx.appcompat.widget.** { *; }
-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }

-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }

您能帮我解决这个问题吗,我可以生成一个签名的apk

最佳答案

您正在使用哪个版本的Android Studio? 3.4?

当您使用R8而不是Proguard进行编译时会发生什么?有时错误消息会更明确。

关于android-studio - Android Studio Gradle版本Build耗时无限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57293076/

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