"No acceptable module found" on Android emulators using com.google.android.gms play-services 9.2.0

I recently updated com.google.android.gms: play-services 9.2.0 and try to use the new Chromecast and Firebase Analytics library, but I get the error "com.google.android.gms.internal. Zzsj $ zza: no acceptable found module. The local version is 0 and the remote version is 0. " in the Activity onCreate method in com.google.android.gms.cast.framework.CastContext. (Unknown source). Any ideas if this is due to the Cast function not working with emulators, or if this is a version issue? The emulators I'm testing with work with 5.0 and 5.1.

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); setupCastListener(); mCastContext = CastContext.getSharedInstance(this); mCastSession = mCastContext.getSessionManager().getCurrentCastSession(); mCastContext.getSessionManager().addSessionManagerListener(mSessionManagerListener, CastSession.class); mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); } 

thanks

+7
android firebase chromecast
source share
4 answers

The version of Play Services on your emulator does not support 9.2.0. Currently, I do not think that the image with the emulator supports 9.2.0. Your parameters should decrease to 9.0.2 or run on a real device until an updated emulator image is released.

If you look closely at your logcat output, you will see the following message:

 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 9080030 

You can see the version number of the GPS that the emulator uses, by selecting Settings / Applications, find Google Play Services and click on it to get information about the application.

You can get the GPS version number from the code by calling GoogleApiAvalability.GOOGLE_PLAY_SERVICES_VERSION_CODE .

This answer contains some related information about the emulator versions.

Update for Adrian Cretu's questions regarding real devices

My experiments show that a Cast application running on a real device can detect an older version of Play Services and trigger permission processing. I experimented with the CastVideos app. My solution may not be the best, but it demonstrates the concept. I created a new action that starts at startup and checks for the existence of Services Services. I modified the manifest to make this action a launch activity, not a VideoBrowserActivity :

 public class InitActivity extends AppCompatActivity { private static final String TAG = "InitActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GoogleApiAvailability googAvail = GoogleApiAvailability.getInstance(); int status = googAvail.isGooglePlayServicesAvailable(this); Log.i(TAG, "onCreate: Status= " + googAvail.getErrorString(status)); googAvail.makeGooglePlayServicesAvailable(this) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { Log.i(TAG, "onComplete: Done"); if (task.isSuccessful()) { Log.i(TAG, "onComplete: Starting VideoBrowser"); startActivity(new Intent(InitActivity.this, VideoBrowserActivity.class)); finish(); } else { Log.e(TAG, "onComplete: RESOLUTION FAILED"); } } }); } } 

If Play Services is present, updated, and VideoBrowserActivity on, a task that checks for availability completes immediately and launches VideoBrowserActivity , the initial launch activity. Otherwise, a dialog box appears informing the user that the Play Services needs to be updated, and after the user agrees, the Play Store opens and the user can start downloading the latest version.

I could not find a way to return to VideoBrowserActivity . I had to restart the application. With a lot of work, I think a clean recovery from obsolete Service Services is possible. At least something is better than a crashing application.

+9
source share

This crash also occurs on real devices with non-updated GPS. I am using Google Cast SDK v3 and GPS 9.2.0

I haven’t noticed anywhere that the device really requires GPS 9.2.0 for Cast V3 to work. What workaround, or at least the solution for the application, doesn't crash at startup?

+1
source share

Remove the emulator and SDK manager, remove the SDK platform on which this emulator was created.

Then reboot this SDK platform and recreate your emulator.

Why?

If the Google Play Services updates were updated since you downloaded the mentioned SDK platform and created this emulator, the outdated version of Google Play Services is probably still in this SDK platform.

It burned 2 hours of my life.

0
source share

When I updated the Google Play developer app for developers , I was able to solve it.

0
source share

All Articles