Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidManifest.out.xml being generated with errors

Tags:

android

Update:

It turned up to be a corrupted AndroidManifest.xml file

  1. I set the logging to verbose to get more info on the error.
  2. I ended up creating a new android project in eclipse and comparing my corrupted AndroidManifest.xml file with the new one.
  3. I added the admob lines one by one.
  4. I cleaned the project and rebuilt it again.

After that it work and I was able to run the emulator.


I've added instructions in my manifest file to include the Admob module which gives me the error message:

Console Message:

Unparsed aapt error(s)! Check the console for output.Unknown    Android Packaging Problem

Error Message:

02:56:23,077 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/Users/eladio/Documents/workspace/NprStationFinder/AndroidManifest.xml
org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/Users/eladio/Documents/workspace/NprStationFinder/AndroidManifest.xml
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:225)

Code Snippet:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.caritos.android.nprstationfinder" android:versionCode="1"
    android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".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>

        <!-- The application's publisher ID assigned by AdMob -->
        <meta-data android:value="xyz" android:name="ADMOB_PUBLISHER_ID" />

        <!-- AdMobActivity definition -->
        <activity android:name="com.admob.android.ads.AdMobActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation|keyboard|keyboardHidden" />

        <!-- Track Market installs -->
        <receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />
    </application>

    <!-- AdMob SDK requires Internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />

    <uses-sdk android:minSdkVersion="4" />
</manifest> 
like image 338
caritos Avatar asked Dec 30 '10 08:12

caritos


2 Answers

This error comes when we run XML file.. delete the main.out. file (from left side). click on corresponding java file and run it.Now it will work properly.. Note: always run Java file.

like image 102
roopa Avatar answered Dec 04 '22 14:12

roopa


I think this is actually an Eclipse thing, not a corrupt XML file? When it happens, look in Run -> Run Configurations under the XSL category and see if there is an entry for AndroidManifest.xml... was it making a ".out" file? If so it's probably Eclipse trying to compile the XML file instead of running it as an Android app. Delete the XSL run configurations, and run your app as one of the android app configurations instead.

Edit: for me this is triggered when Run'ing from an XML window, but not from, e.g., a Java window. One option to change this behavior: Preferences -> Run/Debug -> Launching, under "Launch Operation" select "Always launch the previously launched application". This may bring its own inconvenience, but it works for me for now. I tried in vain to find a way to prevent .XML files from being handled specially.

like image 21
lacinato Avatar answered Dec 04 '22 13:12

lacinato