You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Likely same issue as #409)
When trying to debug the Automotive version of UAMP you get exception (see EXCEPTION1 below) straight away when trying to debug. The reasons seems to be related to gms.cast.framework and no included optionsprovider.
If I include the missing section in automotive manifest from the phone app manifest:
I get a new exception: See EXCEPTION2 below. Perhaps not so strange, since it seems as the optionsprovider is not included in the automotive build.
EXCEPTION1:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.uamp.next, PID: 7512
java.lang.RuntimeException: Unable to create service com.example.android.uamp.automotive.AutomotiveMusicService: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3585)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
at com.google.android.gms.cast.framework.CastContext.zzb(com.google.android.gms:play-services-cast-framework@@18.1.0:23)
at com.google.android.gms.cast.framework.CastContext.getSharedInstance(com.google.android.gms:play-services-cast-framework@@18.1.0:3)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:152)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:88)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.example.android.uamp.media.MusicService.getCastPlayer(Unknown Source:2)
at com.example.android.uamp.media.MusicService.onCreate(MusicService.kt:212)
at com.example.android.uamp.automotive.AutomotiveMusicService.onCreate(AutomotiveMusicService.kt:61)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3573)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/Process: Sending signal. PID: 7512 SIG: 9
EXCEPTION2:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.uamp.automotive, PID: 7229
java.lang.RuntimeException: Unable to create service com.example.android.uamp.automotive.AutomotiveMusicService: java.lang.IllegalStateException: Failed to initialize CastContext.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3585)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: Failed to initialize CastContext.
at com.google.android.gms.cast.framework.CastContext.zzb(com.google.android.gms:play-services-cast-framework@@18.1.0:30)
at com.google.android.gms.cast.framework.CastContext.getSharedInstance(com.google.android.gms:play-services-cast-framework@@18.1.0:3)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:152)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:88)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.example.android.uamp.media.MusicService.getCastPlayer(Unknown Source:2)
at com.example.android.uamp.media.MusicService.onCreate(MusicService.kt:212)
at com.example.android.uamp.automotive.AutomotiveMusicService.onCreate(AutomotiveMusicService.kt:61)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3573)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: com.example.android.uamp.cast.UampCastOptionsProvider
at java.lang.Class.classForName(Native Method)
The text was updated successfully, but these errors were encountered:
After some more investigation I have found that the issue is related to musicservice.kt. Since this class is in the "common" part of the phone and automotive app the usage of the CastPlayer causes the automotive app to crash (automotive perhaps does not support cast?). I have not yet solved the issue, just verified that if I remove the castplayer from MusicService.kt I can get the app running on automotive version.
Thanks for raising this. You're right, automotive OS doesn't support Cast. We need to make some significant architectural changes to MusicService to make this work correctly.
(Likely same issue as #409)
When trying to debug the Automotive version of UAMP you get exception (see EXCEPTION1 below) straight away when trying to debug. The reasons seems to be related to gms.cast.framework and no included optionsprovider.
If I include the missing section in automotive manifest from the phone app manifest:
I get a new exception: See EXCEPTION2 below. Perhaps not so strange, since it seems as the optionsprovider is not included in the automotive build.
EXCEPTION1:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.uamp.next, PID: 7512
java.lang.RuntimeException: Unable to create service com.example.android.uamp.automotive.AutomotiveMusicService: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3585)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
at com.google.android.gms.cast.framework.CastContext.zzb(com.google.android.gms:play-services-cast-framework@@18.1.0:23)
at com.google.android.gms.cast.framework.CastContext.getSharedInstance(com.google.android.gms:play-services-cast-framework@@18.1.0:3)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:152)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:88)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.example.android.uamp.media.MusicService.getCastPlayer(Unknown Source:2)
at com.example.android.uamp.media.MusicService.onCreate(MusicService.kt:212)
at com.example.android.uamp.automotive.AutomotiveMusicService.onCreate(AutomotiveMusicService.kt:61)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3573)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/Process: Sending signal. PID: 7512 SIG: 9
EXCEPTION2:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.uamp.automotive, PID: 7229
java.lang.RuntimeException: Unable to create service com.example.android.uamp.automotive.AutomotiveMusicService: java.lang.IllegalStateException: Failed to initialize CastContext.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3585)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: Failed to initialize CastContext.
at com.google.android.gms.cast.framework.CastContext.zzb(com.google.android.gms:play-services-cast-framework@@18.1.0:30)
at com.google.android.gms.cast.framework.CastContext.getSharedInstance(com.google.android.gms:play-services-cast-framework@@18.1.0:3)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:152)
at com.example.android.uamp.media.MusicService$castPlayer$2.invoke(MusicService.kt:88)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.example.android.uamp.media.MusicService.getCastPlayer(Unknown Source:2)
at com.example.android.uamp.media.MusicService.onCreate(MusicService.kt:212)
at com.example.android.uamp.automotive.AutomotiveMusicService.onCreate(AutomotiveMusicService.kt:61)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3573)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: com.example.android.uamp.cast.UampCastOptionsProvider
at java.lang.Class.classForName(Native Method)
The text was updated successfully, but these errors were encountered: