Решим ошибку «Не удалось найти стиль 'mapViewstyle' в текущей теме»

Извините, что публикую еще один из них, но, похоже, нам еще предстоит задокументировать каждое решение этой проблемы.

Вот что получилось :Я добавил вид карты, все заработало как на дрожжах. Я добавил выдвижной ящик и переместил в него кнопки, затем изменил корневой узел с линейного на относительный. С тех пор я получаю сообщение об ошибке в графическом макете моего класса main.xml, которое гласит

Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'mapViewStyle' in current theme.

Переключение корневого узла на линейный и обратно на относительный привело к отображению карты, но ошибка все еще находится в графическом макете.

До сих пор я сделал следующие решения, которые могут решить проблему в большинстве случаев:

  1. Добавлен файл style.xml для создания стиля «mapView».
  2. Подтверждено, что моей целью сборки является API 2.3.3 (10)
  3. Убедитесь, что <uses-library android:name="com.google.android.maps"/>является дочерним узлом Application.
  4. Очистите/пересоберите мое приложение.
  5. Удален Р.
  6. Удален и перестроен main.xml
  7. Перезапустил сервер adb, Eclipse, мой компьютер и мое устройство.
  8. Переключение между Android 3.0 и Android 2.3.3 в графическом макете.

Однако моя проблема сохраняется. Вот мой макет xml.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >


<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    style="@style/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:apiKey="asdf" //not my real key
    android:clickable="true" />

<!-- TODO: update the API key with release signature -->
<SlidingDrawer
    android:id="@+id/slidingDrawer1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:content="@+id/content"
    android:handle="@+id/handle" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Menu" />


    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/about"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/about" />

        <Button
            android:id="@+id/record"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/record" />

        <Button
            android:id="@+id/start"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/start" />

    </LinearLayout>

</SlidingDrawer>
</RelativeLayout>

Вот мой манифест xml.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.myschoolhere"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="com.google.android.maps"/>
    <activity
        android:name=".GeoTagActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

</manifest>

Если у кого-то есть решение, пожалуйста, дайте мне знать. Я сделаю все возможное, чтобы отправить обратно, если я когда-нибудь понять это.

21
задан Billdr 19 August 2012 в 18:21
поделиться