Android 不幸的是,应用程序停止工作:未能找到样式';mapViewStyle';当前主题
我在这里看到了很多关于这个问题的答案,但没有一个能解决我的问题。我正在尝试制作一个选项卡布局,其中有文本,在表格布局中有文本视图,在表格布局下我要添加地图。我试着这么做,但没有得到结果。 我的错误是Android 不幸的是,应用程序停止工作:未能找到样式';mapViewStyle';当前主题,android,google-maps,android-layout,android-mapview,Android,Google Maps,Android Layout,Android Mapview,我在这里看到了很多关于这个问题的答案,但没有一个能解决我的问题。我正在尝试制作一个选项卡布局,其中有文本,在表格布局中有文本视图,在表格布局下我要添加地图。我试着这么做,但没有得到结果。 我的错误是 Failed to find style 'mapViewStylr' in current theme 添加MapView后,我出现了此错误。当我在NexusOne上运行代码并尝试打开添加MapView的布局时,应用程序不幸停止 这是我的布局代码 <?xml version="1.0" e
Failed to find style 'mapViewStylr' in current theme
添加MapView后,我出现了此错误。当我在NexusOne上运行代码并尝试打开添加MapView的布局时,应用程序不幸停止
这是我的布局代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
>
<ScrollView
android:id="@+id/info_tab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="@+id/venuinfolayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white" >
<TableLayout
android:id="@+id/venuetable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:fitsSystemWindows="true"
android:weightSum="2"
>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/venueaddress"
android:text="Address:"
android:textColor="@android:color/black"
android:padding="6dip"
android:textStyle="bold"
android:textSize="20dip" />
<TextView
android:id="@+id/venueaddress_details"
android:layout_height="wrap_content"
android:layout_width="180dip"
android:singleLine="false"
android:layout_toRightOf="@id/venueaddress"
android:textColor="@android:color/black"
android:text="text"
android:layout_marginLeft="10dip"
android:padding="6dip"
android:textSize="15dip"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/venuephone"
android:layout_below="@id/venueaddress"
android:text="Phone:"
android:textColor="@android:color/black"
android:padding="6dip"
android:textStyle="bold"
android:textSize="20dip" />
<TextView
android:id="@+id/venuephone_details"
android:layout_below="@id/venueaddress_details"
android:layout_toRightOf="@id/venuephone"
android:text="number"
android:textColor="@android:color/black"
android:layout_marginLeft="10dip"
android:padding="6dip"
android:textSize="15dip" />
</TableRow>
</TableLayout>
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/venuetable"
android:clickable="true"
android:apiKey="AIzaSyAvWazTUUQr88b_UqQvB4k5rPAtOhlxTFA" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
遵循Android MapView教程,我尝试构建一个简单的应用程序时遇到了同样的问题 应用程序在文件main.xml的AVD中显示此异常:
Failed to find style 'mapViewStyle' in current theme
最后我发现文件AndroidManifest.xml中有一个错误:
该元素应该是该元素的子元素,而不是直接在其中
希望这对你有帮助
或
//试试这个,它可能会对你有所帮助
将其添加到清单文件中
我检查了我的AndroidManifest.xml,所有的东西都是正确的。有人能说一下如何在linux终端中使用ant builder进行构建吗。我是linux用户。com.google.android.maps.MapView
是不推荐使用的google maps android API v1的一部分。如果你没有调试和释放API密钥,考虑切换到API V2(你将没有API V1显示地图)。我生成了API密钥。但仍然不起作用。我的清单文件中已经有了这个。仍然获取google maps api v1的errorapi密钥的用户已被google maps弃用。目前,您无法通过google maps api v1开发mapview应用程序。
//try this it may help you
Add this into your manifest file
<uses-library android:name="com.google.android.maps" />