java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable in android

后端 未结 10 1779
忘掉有多难
忘掉有多难 2020-11-27 21:33

I tried a demo on displaying google maps v2 in android.

The java code is,

package com.example.gpslocator;

import android.os.Bundle;
import android         


        
相关标签:
10条回答
  • 2020-11-27 22:19

    I had this same issue, and I was able to solve it by right-clicking the google-play-services_lib project and refreshing. For some reason the project wasn't synced with Eclipse which was causing the error.

    0 讨论(0)
  • 2020-11-27 22:24

    When you've imported project google-play-services_lib to your IDE don't forget to check its properties. google-play-services_lib shall be build with the same version of Android SDK that you use for your project. For example your project and google-play-services are both build with Android 4.4.2. After that you should see that the lib is correctly built.

    Finally, you should add the following meta tag to the AndroidManifest.xml inside the <application> ... </application> tags:

    <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • 2020-11-27 22:29

    I have the same issue.

    But What I did is I used com.google.android.gms Version Code this 3265130

    Rather than using com.google.android.gms Version Code this 4452000, Which is the latest one, I don't know what the issue is But its work for me.

    [Follow the steps given by Alexander]

    Might be work well with new Updates.

    enter image description here

    Might be work well with new Updates.

    enter image description here

    0 讨论(0)
  • 2020-11-27 22:29

    The file path to the google-play-services_lib project must have only [A-Z,a-z] not ÄÖÜ. I have moved it to D:\google-play-services_lib\ than imported it new and it works!

    Sorry for my English ;-)

    0 讨论(0)
提交回复
热议问题