本文介绍了无法从AndroidManifest.xml读取packageName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的android清单文件中有错误:
I have errors in my android manifest file:
Error:Cannot read packageName from C:\Users\brandon\AndroidStudioProjects\MineDodge2\app\src\main\AndroidManifest.xml
Error:The markup in the document preceding the root element must be well-formed.
我试图在这个网站上查看,但答案对我不起作用。
I tried to look on this website but the answers aren't working for me.
<?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.brandon.MineDodge" >
<application
android:allowBackup="true"
android:icon="@mipmap/redjet"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.brandon.MineDodge.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.brandon.MineDodge.Splash" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</application>
</manifest>
推荐答案
如果您使用旧版 build.grade 文件,你应该删除这段代码:
If you are using an old version of build.grade file, you should remove this code:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
然后, Build> Clean Project
这篇关于无法从AndroidManifest.xml读取packageName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!