有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

不幸的是,java应用程序已停止在Android emulator上工作

我已经试过杰克的指令了,但我还是会遇到这个错误

我在下面发布了新的日志

05-28 21:10:08.603: A/GmsApplication(3335): Unable to install secure provider, due to exception:
05-28 21:10:08.603: A/GmsApplication(3335): java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.安卓.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ContextImpl.enforce(ContextImpl.java:1914)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:600)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.安卓.gsf.e.c(SourceFile:107)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.安卓.gms.common.security.ProviderInstallerImpl.insertProviderGated(SourceFile:90)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.安卓.gms.common.app.GmsApplication.onCreate(SourceFile:85)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ActivityThread.access$1500(ActivityThread.java:151)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.os.Handler.dispatchMessage(Handler.java:102)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.os.Looper.loop(Looper.java:135)
05-28 21:10:08.603: A/GmsApplication(3335):     at 安卓.app.ActivityThread.main(ActivityThread.java:5257)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-28 21:10:08.940: E/AndroidRuntime(3335): FATAL EXCEPTION: main
05-28 21:10:08.940: E/AndroidRuntime(3335): Process: com.google.安卓.gms.persistent, PID: 3335
05-28 21:10:08.940: E/AndroidRuntime(3335): java.lang.RuntimeException: Unable to create service com.google.安卓.location.internal.GoogleLocationManagerService: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.安卓.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ActivityThread.handleCreateService(ActivityThread.java:2774)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ActivityThread.access$1800(ActivityThread.java:151)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ActivityThread$H.handleMessage(ActivityThread.java:1386)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.os.Handler.dispatchMessage(Handler.java:102)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.os.Looper.loop(Looper.java:135)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ActivityThread.main(ActivityThread.java:5257)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at java.lang.reflect.Method.invoke(Native Method)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at java.lang.reflect.Method.invoke(Method.java:372)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-28 21:10:08.940: E/AndroidRuntime(3335): Caused by: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.安卓.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ContextImpl.enforce(ContextImpl.java:1914)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at 安卓.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)
05-28 21:10:08.940: E/AndroidRuntime(3335):     ... 9 more
05-28 21:10:16.483: E/libEGL(934): called unimplemented OpenGL ES API
05-28 21:10:16.483: E/SurfaceFlinger(934): glCheckFramebufferStatusOES error 1395899833
05-28 21:10:16.483: E/SurfaceFlinger(934): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot

共 (3) 个答案

  1. # 1 楼答案

    插入您的清单文件

     <activity
            android:name=".Yourclassname"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
    
    
    
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="7327000" />
    
  2. # 2 楼答案

    你必须具备以下条件 AndroidManifest中的声明。Xml

    <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 
    

    日志上说的

  3. # 3 楼答案

    异常详细信息在类似日志的日志中清楚地提到

     The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 7327000 but found 0.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    

    根据上述详细信息更改manifestmeta-data标记