【发布时间】:2015-10-19 10:48:47
【问题描述】:
我有几个关于某些属性的明显错误。我没有对应用程序自动生成的清单进行任何更改,但我收到了几个错误。 *(我使用的是 Android Studio 1.2.2)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.iustinian.girlfriendsolver"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.iustinian.girlfriendsolver.MainActivity"
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>
</manifest>
-对于 xmlns:android 属性,我得到“URL 未注册” - 对于 android versionCode , versionName , allowBackup , label 和 theme 我得到“属性不允许在这里”
我查看了清单文档,但找不到答案。例如,allowBackup 属性的放置与文档指定的完全一样。
编辑:环顾四周后,我发现在 android:theme "@style/AppTheme" 我得到一个 no resource matches the given name 。这是 Gradle Build 中唯一出现的内容。我已经多次清理和重建项目。
【问题讨论】:
-
您最近是否切换到 Android Studio/Gradle?
-
您使用的是什么 IDE?我建议你尝试清理你的项目并重建,这通常会解决这些奇怪的错误。如果这不起作用,请告诉我!
-
我刚开始使用 Android Studio 并玩 android 应用程序。我之前在 Eclipse 中没有任何项目可以说从一个迁移到另一个可能是问题所在。
-
过去在清单中指定的某些属性现在应该在您的 build.gradle 文件中指定。其中包括 versionCode、versionName、minSdkVersion 和 targetSdkVersion。如果您的 build.gradle 文件中已经包含这些,则可以安全地从清单中删除它们。
-
解决了“属性不允许在这里”错误。现在我只有@style/AppTheme 问题了。谢谢。
标签: android xml android-studio manifest