Google Maps works fine on Android but I still get an error "Could not find class 'maps.i.k', referenced from method maps.z.ag.a"
Asked Answered
C

6

15

I got Google Maps Android API v2 to work perfectly on my Android Application by downloading the library, adding it to workspace, then referencing it as a library.

But I still get this error as soon as the activity containing the Map Fragment starts

Could not find class 'maps.i.k', referenced from method maps.z.ag.a

By the way I'm using support map fragment

This error does not seem to affect me in anyway nor crash the application nor anything, should I bother fixing it ?

Added the manifest P.S E_SelectJourney is where I display and use the map

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

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

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

    <permission
        android:name="com.HelloMap.AndroidApp.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.HelloMap.AndroidApp.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <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-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <application
        android:allowBackup="true"
        android:configChanges="orientation"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.Sherlock" >
        <uses-library
            android:name="com.google.android.maps"
            android:required="true" />

        <activity
            android:name="com.HelloMap.AndroidApp.A_SplashScreen"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.B_TourSlides"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.C_RegisterLogin"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity android:name="com.facebook.LoginActivity" />
        <activity
            android:name="com.HelloMap.AndroidApp.D_RegistrationPage"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.E_SelectJourney"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.F_EnterFromToAddress"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.G_PickDateTime"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.H_ConfirmContact"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.I_MobileVerification"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.J_AvailableTaxis"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.K_SpecialRequirements"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.L_JourneyOverview"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.M_PaymentOptions"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="com.HelloMap.AndroidApp.N_Confirmation"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="141236504136755" />
    </application>

</manifest>

Added the logcat

03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/p/s; (427)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/p/s;' failed
03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/y/bo; (3820)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/y/bo;' failed
03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/i/k; (4208)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/i/k;' failed
03-26 16:57:14.897: E/dalvikvm(27771): Could not find class 'maps.i.k', referenced from method maps.z.ag.a
03-26 16:57:14.897: W/dalvikvm(27771): VFY: unable to resolve new-instance 3540 (Lmaps/i/k;) in Lmaps/z/ag;
03-26 16:57:15.567: W/SchedPolicy(27771): add_tid_to_cgroup failed to write '' (Invalid argument); background=0
Collaborate answered 28/2, 2013 at 21:15 Comment(6)
Same here! Did you get this to work?Pardew
nope still got the exact same error, but the app always works fineCollaborate
Does this help? #13747955Earing
@Earing I followed it all but still don't know my problemCollaborate
Are you enabled proguard in you application?Tafoya
Not the same problem, but maybe related: I see map-related resource errors in the console, but everything seems to be working fine. #18069127Icono
C
13

Remove this code:

 <uses-library
        android:name="com.google.android.maps"
        android:required="true" />

first of all it's not required for Google Map API V2.

Next, try to move this code to be right before the closing application tag:

 <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />

like that:

 <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
</application>

Finally check that you have turned on the right API service in Google API Console:

enter image description here

You can get more information on both of this topics from this two blog posts I wrote:

Google Maps API V2

and:

Google Maps API V2 key

UPDATE:

For the licensing check this link:

http://android-er.blogspot.co.il/2012/12/include-open-source-software-license.html

basically in some place in your application whether it an activity or a dialog you have to run this:

String LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(getApplicationContext());

and present the result in some form of fashion.

Catadromous answered 26/3, 2013 at 15:56 Comment(7)
followed all your tips, still got the same errors, will add them to the questionCollaborate
I remember doing sth like that, but how/where can I check ?Collaborate
who knows, It might be just that.Catadromous
@EmilAdz i am getting same error and i had perform all task as you wrote here but i can't able to see map , may min api is 8 & target api is 16Henton
@chintankhetiya, please open another question and post here a link, I will try to help you. please go over the Google Maps guide post I posted here and make sure you complete all the steps before posting the questionCatadromous
thanks for your reply. my issue was solves yesterday. problem is that there are two project in my account whose name is API PROJECT so may be conflict there. +1 for your reply.Henton
You mean in the API Console?Catadromous
S
2

I'm not sure but another question has the same error included in it's errors and in that case the app was not signed correctly. If this is the problem you will need to fix it before deploying your app professionally as it will only work in debug mode.

https://mcmap.net/q/102574/-android-google-maps-version-2-not-displaying

Stenotypy answered 26/3, 2013 at 6:28 Comment(1)
I have signed my app for both debug and release keys, I get this error in debug mode, so let's leave release mode aside for now, please have a look at my manifest and tell me if anything's wrongCollaborate
I
2

Try this guide. Creating your Google Map Application

Isogamy answered 26/3, 2013 at 6:32 Comment(6)
I followed the guide, I still can't find my problem, please have a look at my manifest and tell me if i'm doing anything wrong.Collaborate
hmm.. manifest looks good. I think there is some problem in your hash key, try using openssl for sha-1. download openssl-0.9.8e_X64 (the openssl-0.9.8k_X64 won't give you correct hash)It was something like this "C:\Program Files (x86)\Java\jdk1.7.0_07\bin\keytool" -exportcert -alias atif -keystore "H:\Android\All Aliases\Get Inspired\Get Inspired" | "C:\O pesnSSL\bin\openssl" sha1 -binary | "C:\OpesnSSL\bin\openssl" base64Isogamy
btw I have changed the api keys intentionally in this question for privacy reasons, but sure I will try what you saidCollaborate
oh hang on, I don't remember using openssl for google, only used it for facebook apiCollaborate
yeah, I don't know why should I use the command you gave me in your commentCollaborate
and bare in mind I have changed the api keys intentionally in this question for privacy reasonCollaborate
P
2

You should not worry about those Dalvik warnings. I believe those shows up since the Google Maps library is compiled to an API level that is higher than the one running on your phone. Some classes that are available on the higher API are not available on your phone but the library must have some code to compensate for that already.

Phonetist answered 31/3, 2013 at 16:49 Comment(1)
very true, I'm running it on android Froyo API 8Collaborate
M
1

I finally do it! If you're using SupportFragmentMap I think you should turn on the google maps android v2 on the api console, because I was using the Google Maps v2 and it worked fine with FragmentMap but when I changed for SupportFragmentMap to include froyo and gingerbread compatibility it didn't run. I spend 4 stressfull hours searching, trying, coding, changing keys, libraries, updating and... I just turned on the Google Android Maps v2 and turned off the Google Maps v2 and now it's working! Thanks a lot.

Misfit answered 20/9, 2013 at 10:29 Comment(0)
I
0
<uses-library android:name="com.google.android.maps" />

add this library in your manifest file.

Isoline answered 26/3, 2013 at 6:18 Comment(3)
nope didn't work, already have this <uses-library android:name="com.google.android.maps" android:required="true" /> under <application in my manifestCollaborate
that's not required for Google Map API V2Narghile
Don't mix Google Maps API V1 and V2Expel

© 2022 - 2024 — McMap. All rights reserved.