Android Question google maps nodefclassfound error

Discussion in 'Android Questions' started by abcroverix, Feb 9, 2015.

  1. abcroverix

    abcroverix Member Licensed User

    Hello everybody,
    I tried to integrate google maps in my app following the Erel's tutorial.
    After the app starts it creashes with this error:

    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/GooglePlayServicesUtil;
    at anywheresoftware.b4a.objects.MapFragmentWrapper.IsGooglePlayServicesAvailable(MapFragmentWrapper.java:101)
    at b4a.example.main._activity_create(main.java:282)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
    at b4a.example.main.afterFirstLayout(main.java:98)
    at b4a.example.main.access$100(main.java:16)
    at b4a.example.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)

    My b4A version is 3.50.
    I use a nexus 7 with android 5.0.2

    From AVD I installed the google play services and Google Maps api v2.
    Create the key for google maps.

    In my manifest files I add these lines:

    AddManifestText( <permission
    android:name="$PACKAGE$.permission.MAPS_RECEIVE"
    android: protectionLevel="signature"/>
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
    AddApplicationText(<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzaXXXXXXXXXXX"/>)

    AddApplicationText(<meta-data
    android:name="com.google.android.gms.version"
    android:value="@Integer/google_play_services_version" />)

    Where is my mistake?

    Many thanks
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    Did you copy google-play-services-lib library (google-play-services.jar) to the b4a Library directory?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    You must use B4A v3.82+ to use the Google Play Services.
     
  4. abcroverix

    abcroverix Member Licensed User

    Many thanks Erel!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice