15

ライブラリをダウンロードしてワークスペースに追加し、それをライブラリとして参照することで、Google Maps Android API v2 を Android アプリケーションで完全に動作させることができました。

ただし、マップフラグメントを含むアクティビティが開始されるとすぐに、このエラーが発生します

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

ちなみに私はサポートマップフラグメントを使用しています

とにかく、このエラーは私に影響を与えたり、アプリケーションをクラッシュさせたりすることはないようです。わざわざ修正する必要がありますか?

マニフェストを追加しました PS E_SelectJourney は、マップを表示して使用する場所です

<?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>

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
4

6 に答える 6

13

このコードを削除します:

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

まず第一に、それは必須ではありませんGoogle Map API V2

application次に、このコードを終了タグの直前に移動してみてください。

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

そのように:

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

right API service最後に、 inがオンになっていることを確認しますGoogle API Console

ここに画像の説明を入力

この 2 つのトピックの詳細については、私が書いた次の 2 つのブログ投稿を参照してください。

Google マップ API V2

と:

Google マップ API V2 キー

アップデート:

ライセンスについては、次のリンクを確認してください。

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

基本的に、アクティビティであろうとダイアログであろうと、アプリケーションのどこかでこれを実行する必要があります。

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

結果を何らかの形で提示します。

于 2013-03-26T15:56:55.117 に答える
2

このガイドをお試しください。Google マップ アプリケーションの作成

于 2013-03-26T06:32:52.113 に答える
2

よくわかりませんが、別の質問のエラーに同じエラーが含まれており、その場合、アプリは正しく署名されていませんでした。これが問題である場合は、デバッグ モードでのみ機能するため、アプリを専門的に展開する前に修正する必要があります。

https://stackoverflow.com/a/15465572/1873970

于 2013-03-26T06:28:33.430 に答える
2

これらの Dalvik 警告について心配する必要はありません。Google マップ ライブラリは、携帯電話で実行されている API レベルよりも高い API レベルにコンパイルされているため、これらが表示されると思います。上位の API で使用できる一部のクラスは携帯電話では使用できませんが、ライブラリにはそれを補うためのコードが既に含まれている必要があります。

于 2013-03-31T16:49:54.070 に答える
1

ついにやります!SupportFragmentMap を使用している場合は、API コンソールで Google マップ Android v2 を有効にする必要があると思います。なぜなら、私は Google マップ v2 を使用していて、FragmentMap で問題なく動作していたからです。走らない。検索、試行、コーディング、キーの変更、ライブラリの更新、更新などに 4 時間ストレスフルな時間を費やしています。どうもありがとう。

于 2013-09-20T10:29:36.577 に答える
0
<uses-library android:name="com.google.android.maps" />

このライブラリをマニフェスト ファイルに追加します。

于 2013-03-26T06:18:23.433 に答える