Google地图仅适用于我的一款测试手机

时间:2017-08-31 03:32:37

标签: android google-maps

我的测试Google Map应用程序出了问题。 它只能在一部手机上完美运行Xiaomi Redme 3(5.1.1)。 但是,当我在同一台电脑上的另一部手机三星S3 mini(4.1.2)上以调试模式运行它时,它不起作用,只有空白的窗口上有一个铭文谷歌。 它也不适用于华硕Zenphone 5(4.2.2)。

在我的清单文件下面:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="elcom.maps">

    <!--
     The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
     Google Maps Android API v2, but you must specify either coarse or fine
     location permissions for the 'MyLocation' functionality. 
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />


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

    <!--
         The API key for Google Maps-based APIs is defined as a string resource.
         (See the file "res/values/google_maps_api.xml").
         Note that the API key is linked to the encryption key used to sign the APK.
         You need a different API key for each encryption key, including the release key that is used to
         sign the APK for publishing.
         You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    -->
    <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIza..1DM"/>
    <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

还在android监视器日志下面:

08-30 17:29:50.608 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.zze.zzas
08-30 17:29:50.608 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 246 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/zze;
08-30 17:29:50.618 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzs
08-30 17:29:50.618 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 482: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
08-30 17:29:50.638 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.internal.zzacw.zzg
08-30 17:29:50.638 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 27 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/internal/zzacw;
08-30 17:29:50.698 27197-27197/elcom.maps I/zzai: Making Creator dynamically
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method hfi.createCredentialProtectedStorageContext
08-30 17:29:52.140 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 935: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method hfi.createDeviceProtectedStorageContext
08-30 17:29:52.140 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 936: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method com.google.android.chimera.ModuleContext.createCredentialProtectedStorageContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 935: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.150 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method com.google.android.chimera.ModuleContext.createDeviceProtectedStorageContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 936: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.150 27197-27197/elcom.maps I/dalvikvm: Could not find method com.google.android.chimera.ContextThemeWrapper.createDisplayContext, referenced from method com.google.android.chimera.ModuleContext.createDisplayContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 6176: Lcom/google/android/chimera/ContextThemeWrapper;.createDisplayContext (Landroid/view/Display;)Landroid/content/Context;
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isCredentialProtectedStorage, referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 916: Landroid/content/Context;.isCredentialProtectedStorage ()Z
08-30 17:29:52.160 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 355 (Landroid/os/UserManager;) in Lbuc;
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.os.UserManager.isUserUnlocked, referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 1507: Landroid/os/UserManager;.isUserUnlocked ()Z
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method buc.b
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 917: Landroid/content/Context;.isDeviceProtectedStorage ()Z
08-30 17:29:52.170 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method buc.c
08-30 17:29:52.170 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 917: Landroid/content/Context;.isDeviceProtectedStorage ()Z
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 350 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 349 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 351 (SUPPORTED_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 350 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015e at 0x17 in Lbwc;.a
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015d at 0x26 in Lbwc;.a
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015e at 0x0d in Lbwc;.b
08-30 17:29:53.721 27197-27197/elcom.maps I/Google Maps Android API: Google Play services client version: 10084000
08-30 17:29:53.741 27197-27197/elcom.maps I/Google Maps Android API: Google Play services package version: 11302034
08-30 17:29:53.871 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method ji.a
08-30 17:29:53.871 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2148: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
08-30 17:29:53.871 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method ji.a
08-30 17:29:53.871 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 452 (Landroid/os/UserManager;) in Lji;
08-30 17:29:53.881 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.isInstantApp, referenced from method com.google.maps.api.android.lib6.drd.av.a
08-30 17:29:53.881 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2153: Landroid/content/pm/PackageManager;.isInstantApp (Ljava/lang/String;)Z
08-30 17:29:54.592 27197-27197/elcom.maps I/dalvikvm: Could not find method android.widget.RelativeLayout$LayoutParams.setMarginStart, referenced from method com.google.maps.api.android.lib6.impl.o.a
08-30 17:29:54.592 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2878: Landroid/widget/RelativeLayout$LayoutParams;.setMarginStart (I)V
08-30 17:29:55.353 27197-27197/elcom.maps W/age: copyMemory is missing from platform - proto runtime falling back to safer methods.
08-30 17:29:56.434 27197-27197/elcom.maps I/libblt_hw: Library opened (handle = 0, fd = 88)
08-30 17:29:57.355 27197-27543/elcom.maps W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
08-30 17:29:58.286 27197-27543/elcom.maps I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
08-30 17:29:58.286 27197-27543/elcom.maps I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 4
08-30 17:29:58.306 27197-27543/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method ax.createCredentialProtectedStorageContext
08-30 17:29:58.326 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 63: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.326 27197-27543/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method ax.createDeviceProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 64: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createCredentialProtectedStorageContext, referenced from method f.createCredentialProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 365: Le;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createDeviceProtectedStorageContext, referenced from method f.createDeviceProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 366: Le;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createDisplayContext, referenced from method f.createDisplayContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 367: Le;.createDisplayContext (Landroid/view/Display;)Landroid/content/Context;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 76 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 75 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 76 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004c at 0x17 in Laa;.a
08-30 17:29:58.376 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004b at 0x26 in Laa;.a
08-30 17:29:58.396 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004c at 0x0d in Laa;.b
08-30 17:34:06.705 27197-27197/elcom.maps W/InputMethodManager: Ignoring onBind: cur seq=-1, given seq=128

如何解决这个问题? 我读了许多类似的主题,但没有结果。 标准Google Map应用程序在问题设备上运行良好。 我试图重新安装应用程序,清除缓存,但结果相同。

更新: 当我在APIS控制台中将调试密钥的SHA1更改为错误的值时,小米标记出现在灰色空白屏幕上,但在三星只有灰色屏幕上没有标记。

2 个答案:

答案 0 :(得分:0)

如果是发布版本,请务必在此处添加密钥: enter image description here

答案 1 :(得分:0)

这是一个非常奇怪的情况,周末之后所有设备都可以在不更改代码的情况下工作!也许在第二天和其他设备上启用地图会有几天的延迟?