Closed AaronChen0 closed 2 months ago
In a release branch here, the build will fail with the following R8 missing class errors:
WARNING: /home/circleci/code/mobile/build/intermediates/merged_java_res/release/mergeReleaseJavaResource/base.jar: R8: Unexpected reference to missing service class: META-INF/services/java.net.spi.InetAddressResolverProvider.
WARNING: /home/circleci/code/mobile/build/intermediates/merged_java_res/release/mergeReleaseJavaResource/base.jar: R8: Unexpected reference to missing service implementation class in META-INF/services/java.net.spi.InetAddressResolverProvider: org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider.
WARNING: /home/circleci/code/mobile/build/intermediates/merged_java_res/release/mergeReleaseJavaResource/base.jar: R8: Unexpected reference to missing service class: META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor.
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /home/circleci/code/mobile/build/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class lombok.Generated (referenced from: org.slf4j.Logger org.xbill.DNS.Compression.log and 3 other contexts)
Missing class org.slf4j.impl.StaticLoggerBinder (referenced from: void org.slf4j.LoggerFactory.bind() and 3 other contexts)
Missing class org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider (referenced from: java.util.List kotlinx.coroutines.internal.FastServiceLoader.load(java.lang.Class, java.lang.ClassLoader))
Missing class sun.net.spi.nameservice.NameServiceDescriptor (referenced from: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor)
Adding the following to proguard-rules.pro
fixes the R8 errors and the apk works normally.
-dontwarn java.net.spi.InetAddressResolverProvider
-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider
-dontwarn sun.net.spi.nameservice.NameServiceDescriptor
-dontwarn lombok.Generated
I am not familiar with R8 proguard rules, should I just add dontwarn
if the app works normally in my use?
Check the builds here.
Yes add these rules.
-dontwarn lombok.Generated
-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider
-dontwarn sun.net.spi.nameservice.NameServiceDescriptor
Build successfully and work in my phones. Please review.
Thanks! And be patient while I download rust. :)
This is an attempt to update shadowsocks-android to target Android 14 and its dependencies.
Please read this for changes in AGP8. Some build option default values change.
The build succeeded and the debug apk works in both my android 14 and android 12 phones. You can try a debug build apk here. The debug build log can be found here.
Main updates:
1.15.3
to1.20.4
7.6
to8.10
7.4.2
to8.5.2
1.8.10
to2.0.10