小编Bra*_*don的帖子

"AndroidManifest.xml未声明Java包"错误

这可能是一个Linux错误而不是编程错误,但我不确定.AndroidManifest.xml对我来说有些希腊语.也就是说,我的程序编译并运行之前,它的当前状态非常好,甚至在市场上.自从我在Eclipse中打开源代码以来已经有一个月了,今天当我打开它时,它拒绝编译并显示以下错误:

[2010-12-10 10:43:19 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read /media/DATA/code/Android/XXX/AndroidManifest.xml: org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/XXX/AndroidManifest.xml'.

[2010-12-10 10:43:19 - XXX] AndroidManifest.xml does not declare a Java package: Build aborted.
Run Code Online (Sandbox Code Playgroud)

其中XXX是包名(及其所在的目录).我已经确认该文件在文本编辑器中完全正常,甚至在Eclipse中刷新它.没有.

我更新了ADT ......也许AndroidManifest.xml的标准发生了变化?

我的AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest 
 xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.XXX.XXX"
 android:versionCode="2"
 android:versionName="1.0.1"
 >

 <application android:icon="@drawable/icon" android:label="@string/app_name">

     <activity 
      android:name=".XXX"
   android:label="@string/app_name"
   android:screenOrientation="portrait"

   android:theme="@android:style/Theme.NoTitleBar"
   >

   <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />

   </intent-filter>
  </activity>

  <activity 
   android:name=".FindLocationsActivity"
   android:screenOrientation="portrait"
   >
  </activity>

  <activity 
   android:name=".DeveloperActivity"
   android:screenOrientation="portrait"
  >
  </activity>

  <activity 
   android:name=".LegalActivity"
   android:screenOrientation="portrait"
  >
  </activity>

  <activity …
Run Code Online (Sandbox Code Playgroud)

android

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×1