Tôi gặp sự cố nhỏ với Ứng dụng bản đồ Android của tôi. Vì vậy, khi tôi thêm MapView vào tệp xml bố cục của mình, nó sẽ hiển thị cho tôi "Không thể tìm thấy phong cách 'mapViewStyle' trong chủ đề hiện tại" thông báo lỗi.Android - Không thể tìm thấy kiểu 'mapViewStyle' trong chủ đề hiện tại
Dưới đây là AndroidManifest.xml của tôi:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.acilSRV.client"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps"/>
<activity android:name=".AcilActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>
Và main.xml nơi mà thông báo lỗi xuất hiện:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<com.google.android.maps.MapView
android:id="@+id/myMapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="*******"
/>
</LinearLayout>
Lưu ý: Tôi đã kiểm tra chính api Google Maps của tôi và không có vấn đề với Mã API.
Mọi đề xuất?
bạn đã chọn mục tiêu xây dựng bao gồm GoogleApis chưa? –
có, Google Apis - 10 (phiên bản 2.3.3) –
bản sao có thể có của câu hỏi này: http://stackoverflow.com/questions/6975203/android-google-maps-failed-to-find-style-mapviewstyle-in- hiện tại-theme –