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

Android Hello World app fails to build even after adding android.useAndroidX=true #11836

Open
haluzpav opened this issue Jan 16, 2025 · 2 comments
Labels
Milestone

Comments

@haluzpav
Copy link

haluzpav commented Jan 16, 2025

What version of gRPC-Java are you using?

1.69.0

What is your environment?

MacOS Sequoia 15.0.1
javac 23.0.1
Android Studio Ladybug Feature Drop | 2024.2.2

What did you expect to see?

Working hello world project on Android

What did you see instead?

Building client app fails with

> Task :app:dexBuilderDebug FAILED
ERROR:/Users/haluzpav/git/grpc-java/examples/android/helloworld/app/build/intermediates/javac/debug/classes/io/grpc/helloworldexample/HelloworldActivity$1.class: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
ERROR:/Users/haluzpav/git/grpc-java/examples/android/helloworld/app/build/intermediates/javac/debug/classes/io/grpc/examples/helloworld/GreeterGrpc$GreeterStub.class: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
ERROR:/Users/haluzpav/git/grpc-java/examples/android/helloworld/app/build/intermediates/javac/debug/classes/io/grpc/helloworldexample/HelloworldActivity$GrpcTask.class: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null

Full log: error.log

Steps to reproduce the bug

  1. https://grpc.io/docs/platforms/android/java/quickstart/#run-the-example
  2. Which fails, as described in Android Hello World app requires android.useAndroidX=true #11835
  3. Add android.useAndroidX=true into .../helloworld/gradle.properties, as described in the error of the linked issue
  4. Get another error, see above
@shivaspeaks
Copy link
Member

Potential issue could be build tool incompatibility arising from Android Studio (Ladybug Feature Drop 2024.2.2). Did you try this with lower versions of grpc-java? If not, I'd suggest you to do so and narrow down the root cause.

@shivaspeaks shivaspeaks marked this as a duplicate of #11835 Jan 17, 2025
@haluzpav
Copy link
Author

I'm no longer interested. I successfully integrated gRPC into my Android project, with help of various other sources.

I suggest maintainers of this repo just recreate this hello word sample app from scratch, using the latest Android app template in Android Studio, as this current one is outdated basically in all aspects. Easier than trying to debug this IMHO.

@shivaspeaks shivaspeaks added this to the Next milestone Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants