I'm creating custom map app for Android Automotive. Currently I'm facing below errors related with Google Play Services. Could someone teach me resolution for this problem?
Using below environment.
- Emulator image: Android 12L Automotive with Play Store | arm64
- Google Automotive App Host: 1.007.563835132.02-arm64-v8a
- Google Play Services: 23.41.13
- Google Map SDK: com.google.android.gms:play-services-maps:18.2.0
My source code
class CustomMapFragment3: SupportMapFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
startMap(CustomMapFragment3() as Fragment)
}
private fun startMap(fragment: Fragment){
val activityFragmentManager = supportFragmentManager
val activityFragmentTransaction = activityFragmentManager.beginTransaction()
activityFragmentTransaction.add(R.id.framelayout_master,fragment)
activityFragmentTransaction.addToBackStack(null)
activityFragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
activityFragmentTransaction.commit()
}
}
Error Messages
Failed to load maps module, use pre-Chimera
com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module com.google.android.gms.maps_dynamite found. Local version is 0 and remote version is 0.
at com.google.android.gms.dynamite.DynamiteModule.load(com.google.android.gms:play-services-basement@@18.1.0:67)
at com.google.android.gms.maps.internal.zzcc.zzc(com.google.android.gms:play-services-maps@@18.2.0:8)
at com.google.android.gms.maps.internal.zzcc.zzd(com.google.android.gms:play-services-maps@@18.2.0:2)
at com.google.android.gms.maps.internal.zzcc.zza(com.google.android.gms:play-services-maps@@18.2.0:4)
at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@18.2.0:4)
at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@18.2.0:1)
at com.google.android.gms.maps.zzaw.zzc(com.google.android.gms:play-services-maps@@18.2.0:2)
at com.google.android.gms.maps.zzaw.createDelegate(com.google.android.gms:play-services-maps@@18.2.0:1)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.2.0:6)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@18.2.0:1)
at com.google.android.gms.maps.SupportMapFragment.onCreate(com.google.android.gms:play-services-maps@@18.2.0:5)
at com.com.example.test.CustomMapFragment2.onCreate(CustomMapFragment2.kt:25)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:248)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1467)
at android.app.Activity.performStart(Activity.java:8082)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3732)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
2023-10-25 10:25:38.664 5093-5093 DynamiteUtils com.example.test E Failed to load com.google.android.gms.maps_dynamite
pip: No acceptable module com.google.android.gms.maps_dynamite found. Local version is 0 and remote version is 0.
at pit.f(:com.google.android.gms@[email protected] (060408-428111784):68)
at com.google.android.gms.maps.internal.CreatorImpl.e(:com.google.android.gms@[email protected] (060408-428111784):2)
at com.google.android.gms.maps.internal.CreatorImpl.newMapFragmentDelegate(:com.google.android.gms@[email protected] (060408-428111784):1)
at wjq.dO(:com.google.android.gms@[email protected] (060408-428111784):21)
at clz.onTransact(:com.google.android.gms@[email protected] (060408-428111784):11)
at android.os.Binder.transact(Binder.java:1064)
at com.google.android.gms.internal.maps.zza.zzJ(com.google.android.gms:play-services-maps@@18.2.0:2)
at com.google.android.gms.maps.internal.zze.zzf(com.google.android.gms:play-services-maps@@18.2.0:3)
at com.google.android.gms.maps.zzaw.zzc(com.google.android.gms:play-services-maps@@18.2.0:4)
at com.google.android.gms.maps.zzaw.createDelegate(com.google.android.gms:play-services-maps@@18.2.0:1)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.2.0:6)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@18.2.0:1)
at com.google.android.gms.maps.SupportMapFragment.onCreate(com.google.android.gms:play-services-maps@@18.2.0:5)
at com.com.example.test.CustomMapFragment2.onCreate(CustomMapFragment2.kt:25)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:248)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1467)
at android.app.Activity.performStart(Activity.java:8082)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3732)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I tried to below things, but problems have not been resolved yet.
- remove cache and data of App Host then reboot
- changed version of com.google.android.gms:play-services-maps
- added this -keep class com.google.** {*; } to proguard-rules.pro
- changed emulator host machine M1 macOS to x86_64 Windows
My app is working well on my Pixel 7 , Other emulator images for phones.
I got comment about Google Map SDK's policy by Yrll, thank you for sharing of this information.. Google say that developer can use Google map services "com.google.android.gms.maps" in Android Automotive applications, it is written on developer website https://developer.android.com/training/cars/google-services. But as Yrll said, the policy has restriction of using Map SDK for automotive usage, I get confused by these contradiction description.