简体   繁体   中英

Unfortunately Google play services has stopped in emulator

I am getting error message it says Unfortunately,Google play Services has stopped but my map works fine.It doesn't shows any errors in actual devices also.The logcat says

06-23 04:22:04.620    1879-1879/com.google.process.gapps E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.google.process.gapps, PID: 1879
    java.lang.RuntimeException: Unable to create service com.google.android.gms.clearcut.service.ClearcutLoggerIntentService: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10056 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.
            at android.app.ActivityThread.handleCreateService(ActivityThread.java:2568)
            at android.app.ActivityThread.access$1800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)

My build.gradle is

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:7.5.0'
}

My maifest.xml is

 <permission
        android:name="com.nisos.LoqalCab.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.nisos.LoqalCab.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

I have installed com.google.android.gms-7.5.74-1997312-034-APK4Fun.com.apk and com.android.vending-v5.6.8-80360800-Android-2.3.apk

My emulator is running on api level 19 with x86 System Image

I have tried these links “Unfortunately Google Play Services has stopped” but map works fine and run google play store on android emulator .But no luck.What Am I doing wrong?

When using maps you can't use the Normal Emulator and install apks (that is no longer working, it was time ago). Now you need to install the proper emulator "Google API System Image" to let it work.

Alternatively, if the Emulator is not working because outdated (it can be for older API levels) you can donwload Genymotion emulator (which is free) that provides a wide set of devices and api levels. Genymotion does not directly allows GoogleAPIs, but you can download zip file containing google apis (the ones used when flashing custom roms) and install it in genymotion (Drag&Drop the zip over the genymotion emulator), after 1 or 2 restart, your emulator is GoogleAPI compliant :D

I experienced this problem on an Android TV emulator that was previously working just fine. Adding a Google account or signing in with an existing one seemed to fix the issue for me:

Settings -> Add Account -> Sign in/ create new account

Suggestion to sign in was from http://www.techrepublic.com/article/pro-tip-install-google-play-services-on-android-emulator-genymotion/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM