简体   繁体   中英

Google Maps APIv2 unable to run in google nexus7

I have issues running googlemaps in my nexus. Unexpectedly the maps cannot run. I cant really understand what errors the logcat is showing me. Will someone be able to help me? Note: am i getting errors due to the jar files under my Android Private Libraries instead of Android Dependencies?

Logcat

01-04 20:06:04.810: E/AndroidRuntime(2189): java.lang.RuntimeException: Unable to instantiate 
activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MainActivity}: 
java.lang.ClassNotFoundException: Didn't find class "com.example.googlemaps.MainActivity" on 
path: DexPathList[[zip file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=
[/data/app-lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189): java.lang.RuntimeException: Unable to instantiate 
activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MainActivity}: 
java.lang.ClassNotFoundException: Didn't find class "com.example.googlemaps.MainActivity" on 
path: DexPathList[[zip file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=
[/data/app-lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189): java.lang.RuntimeException: Unable to instantiate 
activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MainActivity}: 
java.lang.ClassNotFoundException: Didn't find class "com.example.googlemaps.MainActivity" on 
path: DexPathList[[zip file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=
[/data/app-lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]


01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:2261)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:2261)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread.access$600
(ActivityThread.java:141)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1256)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1256)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.os.Handler.dispatchMessage
(Handler.java:99)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.os.Looper.loop(Looper.java:137)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.ActivityThread.main
(ActivityThread.java:5103)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at java.lang.reflect.Method.invokeNative(Native 
Method)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at java.lang.reflect.Method.invoke
(Method.java:525)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:553)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at dalvik.system.NativeStart.main(Native Method)

01-04 20:06:04.810: E/AndroidRuntime(2189): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "com.example.googlemaps.MainActivity" on path: DexPathList[[zip 
file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "com.example.googlemaps.MainActivity" on path: DexPathList[[zip    
file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "com.example.googlemaps.MainActivity" on path: DexPathList[[zip 
file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "com.example.googlemaps.MainActivity" on path: DexPathList[[zip 
file "/data/app/com.example.googlemaps-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.example.googlemaps-1, /vendor/lib, /system/lib]]

01-04 20:06:04.810: E/AndroidRuntime(2189):     at dalvik.system.BaseDexClassLoader.findClass
(BaseDexClassLoader.java:53)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at dalvik.system.BaseDexClassLoader.findClass
(BaseDexClassLoader.java:53)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at java.lang.ClassLoader.loadClass
(ClassLoader.java:501)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at java.lang.ClassLoader.loadClass
(ClassLoader.java:461)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.Instrumentation.newActivity
(Instrumentation.java:1061)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at android.app.Instrumentation.newActivity
(Instrumentation.java:1061)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)

01-04 20:06:04.810: E/AndroidRuntime(2189):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)

01-04 20:06:04.810: E/AndroidRuntime(2189):     ... 11 more

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemaps"
android:versionCode="1"
android:versionName="1.0" >

<permission 
android:name="com.example.googlemaps.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>


<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>


<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="com.example.googlemaps.MainActivity"
        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.maps.v2.API_KEY"
        android:value="AIzaSyAvphSG5p84T1BlSc1uUufkAczgEIVyoX8"/>

</application>

</manifest>

have you followed the instructions in this link? Google Maps Android API v2 - Google Developers Looking at your manifest, you seem to be missing ...

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

which should be declared within the application element.

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