OOYALA Chromecast integration issue - android

I am integrating ChromeCast in my app which has OOYALA. So the problem I am facing is OOYALA has its own cast SDK and its initialization is done at application level where we pass our cast app id (registered on Google Cast console). As soon as I change OOYALA's sample ID and I try to play a video an exception occurs. Here is the exception:
com.ooyala.android.OoyalaException: cast media load failed with code 2100
at com.ooyala.android.castsdk.CastManager$VideoCastListener.onMediaLoadResult(CastManager.java:87)
at com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager$3.onResult(VideoCastManager.java:1037)
at com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager$3.onResult(VideoCastManager.java:1032)
at com.google.android.gms.internal.zzly$zza.zzb(Unknown Source)
at com.google.android.gms.internal.zzly$zza.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

Related

Android setting up credential using Google API

I want to create an Android application and using Google People Api. I followed all the steps on this tutorial: https://developers.google.com/people/v1/getting-started.
So I created a new project in Google Api Console, get the client id and client secret for a web application, set the consent screen oauth. Finally I tried to run the google code that use can see in the above link, but I get an Exception on creating "GoogleTokenResponse".
I post the exception even if I don't find it useful:
Process: simone.biliato.testpeopleapi, PID: 13067
java.lang.RuntimeException: Unable to start activity ComponentInfo{simone.biliato.testpeopleapi/simone.biliato.testpeopleapi.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NullPointerException
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
at com.google.api.client.auth.oauth2.AuthorizationCodeTokenRequest.setCode(AuthorizationCodeTokenRequest.java:147)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.setCode(GoogleAuthorizationCodeTokenRequest.java:147)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.setCode(GoogleAuthorizationCodeTokenRequest.java:79)
at com.google.api.client.auth.oauth2.AuthorizationCodeTokenRequest.<init>(AuthorizationCodeTokenRequest.java:103)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.<init>(GoogleAuthorizationCodeTokenRequest.java:111)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.<init>(GoogleAuthorizationCodeTokenRequest.java:92)
at simone.biliato.testpeopleapi.MainActivity.setUp(MainActivity.java:63)
at simone.biliato.testpeopleapi.MainActivity.onCreate(MainActivity.java:27)
at android.app.Activity.performCreate(Activity.java:6221)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723) 
at android.app.ActivityThread.access$900(ActivityThread.java:172) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
Has anyone had the same? Is there any working example?
I need to use "Google Button Sign-in"?
I think you can try and use the following example:
https://github.com/sdivakarrajesh/Google-Drive-Java-API
It's for Google Drive Api but you can use the code for permission and then change the scopes.

java.lang.NoClassDefFoundError Android

I was integrating XMPP in my project, it was working fine but it crashed some of the device like Moto G... Below i mentioned crash report
java.lang.NoClassDefFoundError: com.app.xmpp.MyXMPP$MMessageListener
at
com.app.xmpp.MyXMPP.init(MyXMPP.java:88)
at
com.app.xmpp.MyXMPP.<init>(MyXMPP.java:57)
at
com.app.xmpp.MyXMPP.getInstance(MyXMPP.java:63)
at
com.app.xmpp.XmppService.onCreate(XmppService.java:54)
at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2791)
at
android.app.ActivityThread.access$1800(ActivityThread.java:155)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400)
at
android.os.Handler.dispatchMessage(Handler.java:102)
at
android.os.Looper.loop(Looper.java:135)
at
android.app.ActivityThread.main(ActivityThread.java:5343)
at
java.lang.reflect.Method.invoke(Native Method)
at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Help me out how to solve this issue.

Crash in application after updating google play services

I have implemented notifications into my application using Firebase and in the Firebase documentation it suggests that you need to check google play services when using notifications.
I have implemented the check:
public static void checkGooglePlayServices(final Activity activity) {
GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(activity);
}
If the google play services is out of date and the user gets the dialog to update it. If the user follows through and updates the google play services then returns back to the application (after the update is complete) and the user goes back to the previous activity i get the crash below:
Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.example.app/com.example.app.settings.notifications.NotificationSettingsActivity}: java.lang.IllegalStateException: Task is already complete
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3975)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3993)
at android.app.ActivityThread.access$1400(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1524)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5637)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by java.lang.IllegalStateException: Task is already complete
at com.google.android.gms.common.internal.zzac.zza(Unknown Source)
at com.google.android.gms.tasks.zzh.zzTH(Unknown Source)
at com.google.android.gms.tasks.zzh.setException(Unknown Source)
at com.google.android.gms.tasks.TaskCompletionSource.setException(Unknown Source)
at com.google.android.gms.internal.zzabj.onDestroy(Unknown Source)
at com.google.android.gms.internal.zzabu.onDestroy(Unknown Source)
at android.support.v4.app.Fragment.performDestroy(Fragment.java:2434)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1442)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:2951)
at android.support.v4.app.FragmentController.dispatchDestroy(FragmentController.java:271)
at android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:390)
at android.support.v7.app.AppCompatActivity.onDestroy(AppCompatActivity.java:209)
at com.example.app.base.view.BaseActivity.onDestroy(BaseActivity.java:72)
at android.app.Activity.performDestroy(Activity.java:6291)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1148)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3962)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3993)
at android.app.ActivityThread.access$1400(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1524)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5637)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Im not sure why i am getting this crash and where to handle it?

When I import Google`s UniversalMusicPlayer to my android studio, it crashed

I am a newcomer who want to learn android.My friend suggested me to read the code of that player,but when I imported the project and compiled it,it crashed...
12-22 20:58:07.755 4870-4870/com.example.android.uamp
E/AndroidRuntime: FATAL EXCEPTION: main Process:
com.example.android.uamp, PID: 4870 java.lang.RuntimeException: Unable
to start activity
ComponentInfo{com.example.android.uamp/com.example.android.uamp.ui.MusicPlayerActivity}:
java.lang.RuntimeException: com.google.android.gms.internal.zzsb$zza:
No acceptable module found. Local version is 0 and remote version is
0. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2448)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) Caused
by: java.lang.RuntimeException:
com.google.android.gms.internal.zzsb$zza: No acceptable module found.
Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: com.google.android.gms.internal.zzsb$zza: No acceptable
module found. Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzsb.zza(Unknown Source) at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Well,when I searched for answers,the responses were not useful...
And if you have some wonderful open source project to recommend ,hope you can tell me.Thx.
Sorry for my poor english...
You need to update your google play service of device.
You can see this Bug report which already has been addressed
and possibility you will have to update your gcm dependency then appropriate modifications of code will also required mean the deprecated methods will be needed to replaced with new one in the project for e.g GoogleApiAvailability to register token etc so also make sure you are using the latest gcm dependency in your project

App Invites Link in the Mail crashes Google Play Services

I've implemented Google App Invites in my app using this guide : https://developers.google.com/app-invites/android/guides/app
I can send the invite and it is received by the person I invited. The problem is the install button in the email crashes Google Play Services when the app is already installed. It the shows me following error.
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Intent.addFlags(int)' on a null object reference
at com.google.android.gms.appinvite.notification.a.a(SourceFile:219)
at com.google.android.gms.appinvite.a.onPostExecute(SourceFile:29)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Does anybody have a clue to what I'm doing wrong?
The app must have a main activity that has a category of either CATEGORY_INFO or CATEGORY_LAUNCHER.

Categories

Resources