2016-10-11 11 views
5

Bazı cihazlarda bu rastgele istisnaları alıyorum. Ne yaptığımı merak ediyorum. Lütfen bu sorun için daha fazla bilgi sağlayabileceğimi bana bildirin. Bu soruyu daha faydalı hale getirebilmek için başka ne sağlayabilirim? Uygulamamdan ipuçları almıyorum.AndroidManifest.xml, com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME

0 java.lang.RuntimeException: Unable to create service com.google.android.gms.cast.framework.media.MediaNotificationService: 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. 
1 at android.app.ActivityThread.handleCreateService(ActivityThread.java:2474) 
2 at android.app.ActivityThread.access$1600(ActivityThread.java:130) 
3 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293) 
4 at android.os.Handler.dispatchMessage(Handler.java:99) 
5 at android.os.Looper.loop(Looper.java:137) 
6 at android.app.ActivityThread.main(ActivityThread.java:4847) 
7 at java.lang.reflect.Method.invokeNative(Native Method) 
8 at java.lang.reflect.Method.invoke(Method.java:535) 
9 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
10 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
11 at dalvik.system.NativeStart.main(Native Method) 
12 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. 
13 at com.google.android.gms.cast.framework.CastContext.zzbd(Unknown Source) 
14 at com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown Source) 
15 at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source) 
16 at android.app.ActivityThread.handleCreateService(ActivityThread.java:2458) 
17 ... 10 more 
18 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. 
19 at com.google.android.gms.cast.framework.CastContext.zzbd(Unknown Source) 
20 at com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown Source) 
21 at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source) 
22 at android.app.ActivityThread.handleCreateService(ActivityThread.java:2458) 
23 at android.app.ActivityThread.access$1600(ActivityThread.java:130) 
24 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293) 
25 at android.os.Handler.dispatchMessage(Handler.java:99) 
26 at android.os.Looper.loop(Looper.java:137) 
27 at android.app.ActivityThread.main(ActivityThread.java:4847) 
28 at java.lang.reflect.Method.invokeNative(Native Method) 
29 at java.lang.reflect.Method.invoke(Method.java:535) 
30 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
31 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
32 at dalvik.system.NativeStart.main(Native Method) 

Düzen - ManifestFile Uygulamanız Google Cast SDK dayanır yere MediaNotificationService, bağlanmaya çalışıyor

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      package="com.mcruiseon.buseeta"> 


    <!-- For Options menu call support --> 
    <uses-permission android:name="android.permission.CALL_PHONE"/> 

    <!-- To auto-complete the email text field in the login form with the user's emails --> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 

    <!-- To auto-complete the email text field in the login form with the user's emails --> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <!-- For the background service to run forever --> 
    <uses-permission android:name="android.permission.WAKE_LOCK"/> 

    <!-- For Current Location on Driver App --> 
    <permission 
     android:name="${manifestApplicationId}.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature"/> 

    <uses-permission android:name="${manifestApplicationId}.permission.MAPS_RECEIVE"/> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 

    <!-- For QR Code --> 
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/> 
    <uses-permission android:name="android.permission.CAMERA"/> 
    <uses-feature android:name="android.hardware.Camera"/> 
    <uses-permission android:name="android.permission.GET_TASKS"/> 

    <!-- Google Cloud Messaging --> 
    <uses-permission 
     android:name="${manifestApplicationId}.permission.C2D_MESSAGE" 
     android:protectionLevel="signature"/> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> 

    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true"/> 

    <application 
     android:name="com.mcruiseon.buseeta.InitializingApplication" 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:largeHeap="true" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme.NoActionBar"> 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version"/> 

     <meta-data 
      android:name="com.google.android.geo.API_KEY" 
      android:value="${mapsKey}"/> 

     <activity 
      -- MY ACTIVITIES -- 
     </activity> 

    </application> 

</manifest> 
+0

Eğer manifest.xml paylaşır mısınız? Uygulamanızda herhangi bir OptionsProvider veya CastContext uygulamanız var mı, (bağımlı lib, modülden de)? – Devrim

+0

Bu sayfaya baktınız, tezahürünüzde bazı bilgiler eksik ya da başlamak için oraya sahip değilsiniz. "CastOptionsProvider" ın tam olarak bu anahtarın değerine yerleştirilmiş adı olması gerekir, böylece neyi başlatacağınızı bilir. https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastContext –

+0

CastOptionsProvider kullanan herhangi bir etkinlik veya çağrı yok. – Siddharth

cevap

4

. OptionsProvider'ı genişleten bir sınıf oluşturmanız gerekir. Ardından, bu gibi, Manifest'te oluşturduğunuz sınıfı kaydetmek gerekir: Bu konuda

<application> 
    ... 
    <meta-data 
    android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME" 
    android:value="com.example.myapp.CastOptionsProvider" /> 
</application> 

bilgiler burada bulunabilir: https://developers.google.com/cast/docs/android_sender_integrate#initialize_the_cast_context

+0

Proje yolumda 'MediaNotificationService' aradım, sadece http: // localhost: 63342/ejc0j33aagk0icfd5p5uzxok4wxbcb1nirr6q/Buseeta/build/intermediates/exploded-aar/com.google.android.gms/play-services- içinde buldum. dökme çerçeve/9.4.0/AndroidManifest.xml'. Benim manifest veya kod başka bir yerde 'MediaNotificationService' kullanmıyorum. Merak ediyorum neden bu giriyor? – Siddharth

+0

Bir "gradlew clean" yaptım ve yeniden arama yaptım, proje yolunda "MediaNotificationService" referansını bulamadım. ./gradlew assembleRelease yaptım ve tekrar arama yaptım, ** ** http: // localhost: 63342/ejc0j33aagk0icfd5p5uzxok4wxbcb1nirr6q‌/Buseeta/build/inter‌ mediates/exploded againde yine 'MediaNotificationService 'referansını bulamıyordum ** aa r/com.google.android .gms/oynatma-hizmetler-c ast-çerçeve/9.4.0/'. – Siddharth

+0

Bu, özel durum çökmesini onarır mı? – Siddharth

0
public class CastOptionsProvider implements OptionsProvider { 
     @Override 
     public CastOptions getCastOptions(Context appContext) { 

     } 
    } 



<meta-data 
     android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME" 
     android:value="com.example.app.CastOptionsProvider" /> 
İlgili konular