問題描述
也許我在這里遺漏了一些東西,但我無法在 Play Services 6.5 中使用新的 Maps only 依賴項
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"/>
Gradle 文件:
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 限制,我不想使用 multidex
The full bundle pushes me over the dex limit and I would prefer not to use multidex
推薦答案
通過 SDK 管理器將您的 Google 存儲庫 更新到版本 15
應該可以解決問題并消除需求對于解決方法.需要清理項目.
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.
issue 7432
This is also mentioned in issue 7432.
這篇關于NoSuchFieldError:在使用 MapFragment 和 Play Services 6.5 時沒有類型的靜態字段 MapAttrs的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!