Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to AGP 8 #10152

Open
ejona86 opened this issue May 8, 2023 · 2 comments
Open

Upgrade to AGP 8 #10152

ejona86 opened this issue May 8, 2023 · 2 comments
Assignees
Milestone

Comments

@ejona86
Copy link
Member

ejona86 commented May 8, 2023

To upgrade to Gradle 8 we will need to upgrade to Android Gradle Plugin 8. And that will require Java 17. It also enables things like R8 full mode.

@DevDema
Copy link

DevDema commented May 9, 2023

I've got a problem that might be related to this.

I'm using these two dependencies:

implementation "io.grpc:grpc-okhttp:1.48.1" implementation "io.grpc:grpc-android:1.48.1"

on my Android project.
I've tried updating Gradle to 8. Everything looks good except for the task:

minifyJottacloudReleaseWithR8 where I get a bunch of missing classes, especially a couple of interesting ones:

Missing class javax.naming.NamingEnumeration (referenced from: void io.grpc.internal.JndiResourceResolverFactory$JndiRecordFetcher.closeThenThrow(javax.naming.NamingEnumeration, javax.naming.NamingException) and 1 other context)
Missing class javax.naming.NamingException (referenced from: void io.grpc.internal.JndiResourceResolverFactory$JndiRecordFetcher.closeThenThrow(javax.naming.NamingEnumeration, javax.naming.NamingException) and 4 other contexts) 

I've tried ignoring them with this on the proguard file:

-dontwarn javax.naming.**

But then I get a lot of runtime crashes stating:

Fatal Exception: java.lang.IllegalAccessError: Illegal class access ('xxx.xxx.LogInterceptor$interceptCall$1$start$listener$1' attempting to access 'io.grpc.PartialForwardingClientCallListener') in attempt to invoke super method void io.grpc.PartialForwardingClientCallListener.onClose(io.grpc.Metadata, io.grpc.Status) (declaration of 'xxx.xxx.LogInterceptor$interceptCall$1$start$listener$1' appears in base.apk!classes3.dex)

My guess is that grpc-okhttp or grpc-android are using javax.naming references which don't exist in java 17 anymore, and there's nothing I can do about it.

I'm putting this Gradle update on stale until you guys fix it.

@ejona86
Copy link
Member Author

ejona86 commented May 9, 2023

@DevDema, this is for our internal build, so should not be used for your issues.

That first part looks to be the same as #10057. It is safe to ignore. Those JNDI classes have never existed on Android. See #5422 for previous discussion for those classes.

Open a separate issue for that PartialForwardingClientCallListener issue. That seems to be because ForwardingClientCallListener extends PartialForwardingClientCallListener, but PartialForwardingClientCallListener is package-private. Seems like an R8 or Android bug, but we'll also need to see what we can do about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants