Skip to content

[Bug]: Android Auto app crashes the app in release - java.lang.NoSuchMethodError #534

@eminsr

Description

@eminsr

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Running the example app in release mode connected to a heads up unit crashes the app.

02-12 11:27:34.287 20276 20276 E AndroidRuntime: Process: com.sampleapp, PID: 20276
02-12 11:27:34.287 20276 20276 E AndroidRuntime: java.lang.NoSuchMethodError: No static method getNavInfoLiveData()Landroidx/lifecycle/LiveData; in class Lcom/google/android/react/navsdk/NavInfoReceivingService; or its super classes (declaration of 'com.google.android.react.navsdk.NavInfoReceivingService' appears in /data/app/~~lB5P-dafQS9Vr3vKPMq-vg==/com.sampleapp-fw8HshqO8P6X6CcySLGFHQ==/base.apk)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at m4.f.<init>(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:20)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at m4.g.f(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:71)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at androidx.car.app.CarAppBinder.i(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:165)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at androidx.car.app.n.a(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:9)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at androidx.car.app.utils.RemoteUtils.d(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:1)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at androidx.car.app.utils.d.run(r8-map-id-aa547c680ed44abbaeaff6e7953b0d22100289a03ecb46ee3f374993692cbef3:7)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:995)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:103)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:273)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:363)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:10060)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
02-12 11:27:34.287 20276 20276 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

React Native version

0.83.1

React version

19.2.0

Package version

0.14.0

Native SDK versions

  • I haven't changed the version of the native SDKs

React Native Doctor Output

Common
 ✓ Node.js - Required to execute JavaScript code
 ✓ yarn - Required to install NPM dependencies
 ✓ npm - Required to install NPM dependencies
 ✓ Watchman - Used for watching changes in the filesystem when in development mode
 ✓ Metro - Required for bundling the JavaScript code

Android
 ✓ Adb - Required to verify if the android device is attached correctly
 ✓ JDK - Required to compile Java code
 ✓ Android Studio - Required for building and installing your app on Android
 ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
 ✓ Gradlew - Build tool required for Android builds
 ✓ Android SDK - Required for building and installing your app on Android

iOS
 ✓ Xcode - Required for building and installing your app on iOS
 ✓ Ruby - Required for installing iOS dependencies
 ✓ CocoaPods - Required for installing iOS dependencies
 ✓ .xcode.env - File to customize Xcode environment

Errors:   0
Warnings: 0

Steps to reproduce

  1. Fetch the latest example app as of v0.14.0.
  2. Add your maps api key to MAPS_API_KEY value in /android/local.properties file.
  3. Run yarn install
  4. Run yarn android-release
  5. Start the navigation in the Sample main app.
  6. Start Android Auto - Desktop Head Unit and open the app in the unit.
  7. Experience the main app crashing.

Expected vs Actual Behavior

I'd expect for the app to not crash like it works in the dev mode.

Code Sample

Example code here

Additional Context

Android Auto Head Unit that I'm using;

Android Auto - Desktop Head Unit
  Build: 2022-03-30-438482292
  Version: 2.0-mac-arm64

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions