Android地图:未能找到样式';mapViewStyle';当前主题
我试图在我的应用程序中使用地图,但我遇到了这个错误, 在当前主题中找不到样式“mapViewStyle” 我已经正确地生成了密钥,并在其他地方尝试了针对同一问题提供的所有解决方案Android地图:未能找到样式';mapViewStyle';当前主题,android,xml,google-maps,Android,Xml,Google Maps,我试图在我的应用程序中使用地图,但我遇到了这个错误, 在当前主题中找不到样式“mapViewStyle” 我已经正确地生成了密钥,并在其他地方尝试了针对同一问题提供的所有解决方案 1.my target api and the one mentioned in the manifest file are the same. 2.There is no import.R in my project 3.I have cleaned my project. 4.Uses-library elemen
1.my target api and the one mentioned in the manifest file are the same.
2.There is no import.R in my project
3.I have cleaned my project.
4.Uses-library element is a child of the application.
这是我的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:apiKey="*****************"
android:enabled="true"
/>
</LinearLayout>
请帮帮我。。。
谢谢。我的答案可能晚了,但我希望它能解决实际原因,并确保它能对那些将来要研究相同问题的人有所帮助 这类错误,
1. Android Google Maps Failed to find style 'mapViewStyle' in current theme
2. Failed to find style 'imageButtonStyle' in current theme
3. Failed to find style 'editTextStyle' in current theme
4. Failed to find style 'textViewStyle' in current theme
上面列出的任何东西都可能是
最终原因是,
我们已为布局
选择了不可用的主题
这可能是由于以下原因造成的:
主题
在themes.xml
文件中不可用主题
属于更高版本的sdk
,但我们当前的目标sdk
是较低的布局
文件并尝试在项目中实现它时。
A.您可能忘记复制themes.xml
文件
B您可以使用较低的目标sdk
,即使用较高的目标sdk
创建的原始布局
图形布局视图中的布局文件,然后查看右上角。
您的布局的主题
已被选中。)
因此,单击主题
选择的下拉列表,并根据您的项目主题
和目标sdk主题
选择可用的主题。
(或)
如果主题
是一个自定义
主题,如果需要,请将themes.xml
文件从复制布局xml
文件的源复制到项目中。
(或)
如果主题
是sdk
avail主题
,如果需要,则根据您选择的主题
更改您的目标
希望-这可能对某些人有所帮助。我想我应该补充一下这一点。我在上面得到了错误4。我花了很长时间才意识到,我为我的首选项所做的主题会自动应用到我已经制作的每个布局文件中。如上所述选择一个不同的解决了我的问题。我不知道为什么Android Studio会自动将它应用到我所有的其他布局中,但我希望它不会
我仍然不知道为什么我制作的主题打破了一切,因为它只是在我的首选项页面上应用背景色,但希望有一天我会这样做。重复?我同意dmon的观点,查看他/她引用的问题并查看文档
1. Android Google Maps Failed to find style 'mapViewStyle' in current theme
2. Failed to find style 'imageButtonStyle' in current theme
3. Failed to find style 'editTextStyle' in current theme
4. Failed to find style 'textViewStyle' in current theme