方法如下
首先,没有R文件是个大问题。布局有错误
查看 res/values/styles.xml 下的报错点。
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
把这个改成
<style name="AppBaseTheme" parent="android:Theme.Light">
路径: res/values-11/styles.xml
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
把这个改成
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
路径: res/values-14/styles.xml
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
把这个换成
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
main.xml中
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never"/>
把这个中的app换成android
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
android:showAsAction="never"/>
等读完workspace后R文件还没出来的clean一下就好了
今天在我导入一些安卓项目的源码的时候会出现style.xml 和MAIN.xml 等错误, 网上的方法试了各种clean各种fix等方法都是不能解决。最后去国外论坛得到解决
最新推荐文章于 2021-09-15 09:42:38 发布