API 10 で Google Maps API を使おうとすると、Google Play サービスに対応していませんと表示されます。
使用しています: android.support.v4.app.FragmentActivity および com.google.android.gms.maps.SupportMapFragment... Google Play サービスを lib としてインポートします。 com/maps/documentation/android/start 何が足りないのですか??? 編集:別の電話API 17を使用すると、マップがうまく機能します。つまり、キーが機能しています。
MainActivity.java
package com.xoco.gasolina;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Activiy_main.xml
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
マニフェスト :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xoco.gasolina"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="com.xoco.gasolina.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="com.xoco.gasolina.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" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.xoco.gasolina.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="***MyKey***" />
</application>
logcat にエラー メッセージはありません。アプリは正常に動作しますが、次のような画面が表示されます。一部のアプリケーションが依存している Google Play サービスは、デバイスでサポートされていません。サポートが必要な場合は、製造元にお問い合わせください。警告は次のとおりです。
01-05 23:27:13.294: W/PackageManager(112): Mounting container com.xoco.gasolina-1
01-05 23:27:15.034: W/PackageManager(112): Code path for pkg : com.xoco.gasolina changing from /mnt/asec/com.xoco.gasolina-2/pkg.apk to /mnt/asec/com.xoco.gasolina-1/pkg.apk
01-05 23:27:15.034: W/PackageManager(112): Resource path for pkg : com.xoco.gasolina changing from /mnt/asec/com.xoco.gasolina-2/pkg.apk to /mnt/asec/com.xoco.gasolina-1/pkg.apk
01-05 23:27:15.204: W/PackageManager(112): Unknown permission com.android.vending.permission.UPDATE_MARKET_FAILURE in package com.android.vending.updater
01-05 23:27:15.214: W/PackageManager(112): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
01-05 23:27:15.214: W/PackageManager(112): Unknown permission android.permission.ACCESS_SUPERUSER in package com.buak.Link2SD
01-05 23:27:15.224: W/PackageManager(112): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
01-05 23:27:15.224: W/PackageManager(112): Unknown permission android.permission.READ_OWNER_DATA in package com.google.android.email
01-05 23:27:15.224: W/PackageManager(112): Unknown permission android.permission.STORAGE in package com.whatsapp
01-05 23:27:15.224: W/PackageManager(112): Unknown permission android.permission.READ_PROFILE in package com.whatsapp
01-05 23:27:15.234: W/PackageManager(112): Unknown permission android.permission.READ_OWNER_DATA in package com.android.setupwizard
01-05 23:27:15.234: W/PackageManager(112): Unknown permission android.permission.WRITE_OWNER_DATA in package com.android.setupwizard
01-05 23:27:15.234: W/PackageManager(112): Not granting permission android.permission.DEVICE_POWER to package com.google.android.deskclock (protectionLevel=2 flags=0x8be45)
01-05 23:27:15.234: W/PackageManager(112): Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.google.android.gms
01-05 23:27:15.244: W/PackageManager(112): Unknown permission android.permission.READ_EXTERNAL_STORAGE in package com.google.android.gms
01-05 23:27:15.244: W/PackageManager(112): Unknown permission android.permission.LOCATION_HARDWARE in package com.google.android.gms
01-05 23:27:15.244: W/PackageManager(112): Unknown permission android.permission.GET_APP_OPS_STATS in package com.google.android.gms
01-05 23:27:15.244: W/PackageManager(112): Unknown permission android.permission.UPDATE_APP_OPS_STATS in package com.google.android.gms
01-05 23:27:15.254: W/PackageManager(112): Unknown permission android.permission.READ_SOCIAL_STREAM in package com.google.android.gms
01-05 23:27:15.254: W/PackageManager(112): Unknown permission android.permission.WRITE_SOCIAL_STREAM in package com.google.android.gms
01-05 23:27:15.254: W/PackageManager(112): Not granting permission com.google.android.gm.permission.READ_GMAIL to package com.google.android.apps.uploader (protectionLevel=2 flags=0xbe45)
01-05 23:27:15.264: W/PackageManager(112): Unknown permission android.permission.READ_EXTERNAL_STORAGE in package com.android.vending
01-05 23:27:15.264: W/PackageManager(112): Not granting permission android.permission.CHANGE_COMPONENT_ENABLED_STATE to package com.android.vending (protectionLevel=3 flags=0xabec5)
01-05 23:27:15.264: W/PackageManager(112): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.vending (protectionLevel=2 flags=0xabec5)
01-05 23:27:15.264: W/PackageManager(112): Unknown permission android.permission.SEND_SMS_NO_CONFIRMATION in package com.android.vending
01-05 23:27:15.274: W/PackageManager(112): Not granting permission android.permission.STATUS_BAR to package com.android.vending (protectionLevel=3 flags=0xabec5)
01-05 23:27:15.274: W/PackageManager(112): Not granting permission android.permission.PACKAGE_USAGE_STATS to package com.android.vending (protectionLevel=2 flags=0xabec5)
01-05 23:27:15.274: W/PackageManager(112): Unknown permission android.permission.PACKAGE_VERIFICATION_AGENT in package com.android.vending
01-05 23:27:15.274: W/PackageManager(112): Unknown permission android.permission.MANAGE_USERS in package com.android.vending
01-05 23:27:15.274: W/PackageManager(112): Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.android.vending
01-05 23:27:15.274: W/PackageManager(112): Not granting permission android.permission.WRITE_SECURE_SETTINGS to package com.android.vending (protectionLevel=3 flags=0xabec5)
01-05 23:27:15.274: W/PackageManager(112): Unknown permission android.permission.ACCESS_SUPERUSER in package com.estrongs.android.pop
01-05 23:27:15.274: W/PackageManager(112): Unknown permission .PERMISSION in package com.estrongs.android.pop
01-05 23:27:15.274: W/PackageManager(112): Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
01-05 23:27:15.284: W/PackageManager(112): Unknown permission com.google.android.apps.googlevoice.REMOTE_INTENT in package com.google.android.apps.googlevoice
01-05 23:27:15.284: W/PackageManager(112): Unknown permission com.google.android.permission.RECEIVE_DATA_MESSAGE in package com.google.android.apps.googlevoice
01-05 23:27:15.284: W/PackageManager(112): Unknown permission com.google.android.permission.SEND_DATA_MESSAGE in package com.google.android.apps.googlevoice
01-05 23:27:16.114: W/dalvikvm(2343): VFY: unable to resolve static field 80 (BLOCKED) in Landroid/net/NetworkInfo$DetailedState;
01-05 23:27:16.124: W/dalvikvm(2343): VFY: unable to resolve static method 633: Landroid/net/TrafficStats;.setThreadStatsTag (I)V
01-05 23:27:16.154: W/dalvikvm(2343): VFY: unable to resolve static method 903: Landroid/provider/Settings$Global;.getInt (Landroid/content/ContentResolver;Ljava/lang/String;I)I
01-05 23:27:16.174: W/dalvikvm(2343): Link of class 'Lcom/google/android/finsky/widget/recommendation/RecommendationsViewFactory;' failed
01-05 23:27:16.174: W/dalvikvm(2343): VFY: unable to resolve static method 19849: Lcom/google/android/finsky/widget/recommendation/RecommendationsViewFactory;.notifyDataSetChanged (Landroid/content/Context;[I)V
01-05 23:27:16.194: W/dalvikvm(2343): VFY: unable to resolve instance field 49
01-05 23:27:17.304: W/dalvikvm(2404): VFY: unable to resolve instance field 28
01-05 23:27:17.684: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.684: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.
01-05 23:27:17.704: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.704: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.
01-05 23:27:17.704: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.704: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.
01-05 23:27:17.714: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.714: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.
01-05 23:27:17.724: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.724: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.
01-05 23:27:17.734: W/GooglePlayServicesUtil(2404): Certificate is not yet valid.
01-05 23:27:17.734: W/GooglePlayServicesUtil(2404): Google Play Store signature invalid.