Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 518 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proguard Missing classes detected while running R8 after adding package names in proguard-rules.pro

#1
`AGPBI` gives this as output:

> Task :app:minifyReleaseWithR8
AGPBI: {"kind":"warning","text":"Unexpected reference to missing service class: META-INF/services/reactor.blockhound.integration.BlockHoundIntegration.","sources":[{"file":"/app/build/intermediates/merged_java_res/release/base.jar"}],"tool":"R8"}

AGPBI: {"kind":"warning","text":"Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /app/build/outputs/mapping/release/missing_rules.txt.\n","sources":[{}]}

AGPBI: {"kind":"warning","text":"Missing class com.aayushatharva.brotli4j.Brotli4jLoader (referenced from: void io.netty.handler.codec.compression.Brotli.<clinit>() and 2 other contexts)\n

Missing class com.aayushatharva.brotli4j.decoder.DecoderJNI$Status (referenced from: void io.netty.handler.codec.compression.BrotliDecoder$1.<clinit>() and 1 other context)\n
Missing class com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper (referenced from: com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper io.netty.handler.codec.compression.BrotliDecoder.decoder and 4 other contexts)\n
Missing class com.aayushatharva.brotli4j.encoder.Encoder$Mode (referenced from: void io.netty.handler.codec.compression.BrotliOptions.<clinit>())\n
Missing class com.aayushatharva.brotli4j.encoder.Encoder$Parameters (referenced from: com.aayushatharva.brotli4j.encoder.Encoder$Parameters io.netty.handler.codec.compression.BrotliEncoder.parameters and 7 other contexts)\n
Missing class com.aayushatharva.brotli4j.encoder.Encoder (referenced from: io.netty.buffer.ByteBuf io.netty.handler.codec.compression.BrotliEncoder.allocateBuffer(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, boolean))\n
Missing class com.android.org.conscrypt.SSLParametersImpl (referenced from: void org.conscrypt.KitKatPlatformOpenSSLSocketImplAdapter.<init>(org.conscrypt.AbstractConscryptSocket))\n
Missing class com.github.luben.zstd.Zstd (referenced from: io.netty.buffer.ByteBuf io.netty.handler.codec.compression.ZstdEncoder.allocateBuffer(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, boolean) and 1 other context)\n
Missing class com.google.protobuf.ExtensionRegistry (referenced from: void io.netty.handler.codec.protobuf.ProtobufDecoder.<init>(com.google.protobuf.MessageLite, com.google.protobuf.ExtensionRegistry))\n
Missing class com.google.protobuf.ExtensionRegistryLite (referenced from: com.google.protobuf.ExtensionRegistryLite io.netty.handler.codec.protobuf.ProtobufDecoder.extensionRegistry and 2 other contexts)\n

The missing files seem to be part of the `bouncycastle` library. Here is my `proguard` file:

-keep class org.spongycastle.** { *; }
-dontwarn org.spongycastle.**

# When I remove this, java.security.cert.CertificateException: X.509 not found is thrown
-keep class org.bouncycastle.** { *; }
-keep interface org.bouncycastle.**

# I got the missing classes from missing_rules.txt and added the package names that created the problem here:
-keep class org.conscrypt.** { *; }
-keep class io.netty.** { *; }

-keep class com.aayushatharva.** { *; }

-keep class ** { *; }

**build.gradle (app):**

implementation "org.conscrypt:conscrypt-android:$conscrypt"
implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.69'

Why does it still gives the error while I add the correct missing package names?
Reply

#2
The missing classes warning tells that the mentioned classes are not present in the input (your source and dependencies) or in the referenced library (Android runtime library `android.jar` provided form the Platfrom SDK in this case). When R8 traces the program it will try to handle all the classes, methods and fields that it finds in the part of the program it considers live. Keeping all classes in a package will not change that. There are two options in this case:

1. Find the missing dependency and add it to the project
2. Ignore the warning using a `-dontwarn` as the class is expected to be missing.

For the warning on the class `com.android.org.conscrypt.SSLParametersImpl` adding a
```
-dontwarn com.android.org.conscrypt.SSLParametersImpl`
```
is the right thing to do, as looking at the [source](

[To see links please register here]

) shows that the class extends a class which will be in the KitKat runtime, but not in the app (and also not in `android.jar`).

For the remaining warnings a similar decision has to be made.
Reply

#3
Write the -dontwarn rules in the missing_rules.txt file into the proguard-rules file
Reply

#4
Write the -dontwarn rules in the proguard-rules file

-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
Reply

#5
These rules worked for me


-dontwarn com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite**

-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
Reply

#6
1. Go to proguard-rules file (this file is available in Gradle Scripts)
2. add this rules in proguard-rules file
```
-dontwarn android.media.Spatializer$OnSpatializerStateChangedListener

-dontwarn android.media.Spatializer
```


Reply

#7
Not directly OP's issue, but if you find R8 failing your builds about missing rules and you're using an older version of OkHttp, you can upgrade OkHttp to 4.11.0 for [the necessary Proguard rules][1] instead of adding them to your project.


[1]:

[To see links please register here]

Reply

#8
You can disable minifyEnabled when debug the app since you are debugging the app on your phone but for the release version let minifyEnabled true ;

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.ProfileForsign
}
debug {
signingConfig signingConfigs.ProfileForsign
debuggable true
minifyEnabled false
}
}
Reply

#9
I upgrade gradle to `8.0` when i package my app I get the same problem.

this is the error message

*Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in **you path to mmissing_rules.txt***

I follow the path to mmissing_rules.txt like this

app -> build -> outputs -> mapping -> your_app_name -> missing_rules.txt

I get those message

# Please add these rules to your existing keep rules in order to
suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn android.os.ServiceManager
-dontwarn com.bun.miitmdid.core.MdidSdkHelper
-dontwarn com.bun.miitmdid.interfaces.IIdentifierListener
-dontwarn com.bun.miitmdid.interfaces.IdSupplier
-dontwarn com.google.firebase.iid.FirebaseInstanceId
-dontwarn com.google.firebase.iid.InstanceIdResult
-dontwarn com.huawei.hms.ads.identifier.AdvertisingIdClient$Info
-dontwarn com.huawei.hms.ads.identifier.AdvertisingIdClient
-dontwarn com.tencent.android.tpush.otherpush.OtherPushClient

I copy those message into `proguard-rules.pro` then i fix this problem.

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through