NoSuchFieldError:类型与播放业务6.5使用MapFragment时没有静态字段MapAttrs字段、静态、类型、业务

2023-09-12 08:41:31 作者:泪只为你流

也许我失去了一些东西,但我不能够使用新的地图只在播放业务的依赖性6.5

Maybe I am missing something here, but I am not able to use the new Maps only dependency in Play Services 6.5

我得到以下异常:

java.lang.NoSuchFieldError: No static field MapAttrs of type 
    [I in class Lcom/google/android/gms/R$styleable; or its superclasses 
    (declaration of 'com.google.android.gms.R$styleable' appears in 
    /data/app/com.kaching.merchant.dev1-1/base.apk)
        at com.google.android.gms.maps.GoogleMapOptions
            .createFromAttributes(Unknown Source)
        at com.google.android.gms.maps.SupportMapFragment
            .onInflate(Unknown Source)

清单:

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

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


<uses-permission 
  android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

摇篮文件:

compile 'com.google.android.gms:play-services-maps:6.5.+'
compile 'com.android.support:support-v4:21.0.2'

布局:

<fragment
   android:id="@+id/map"
   android:name="com.google.android.gms.maps.MapFragment"
   android:layout_width="match_parent"
   android:layout_height="match_parent"/>

这是坏了还是我做错了什么?

Is this broken or am I doing something wrong?

全包推我在DEX极限,我想preFER不使用multidex

The full bundle pushes me over the dex limit and I would prefer not to use multidex

推荐答案

更​​新您的谷歌信息库的到版本 15 通过SDK管理器应该解决这些问题并消除了解决方法的需要。一个项目的清洁是必要的。

Updating your Google Repository to version 15 via the SDK Manager should resolve the issues and eliminate the needs for the workarounds. A project clean is required.

这是也提到问题7432 。