Failed to package application when Android Manifes

2019-09-05 10:45发布

问题:

I started a new test app, and downloaded a Holo Theme (by name JSTheme) from Android-holo-colors.com And replaced the /res folder contents with the res folder in that downloaded zip file.

But when I replace the line in tiapp.xml

<android xmlns:android="http://schemas.android.com/apk/res/android" />

to this, then the compile is not happening. It shows then: [ERROR] : Failed to package application: [ERROR] Application Installer abnormal process termination. Process exit value was 1

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <tool-api-level>14</tool-api-level>
    <manifest>
        <application android:theme="@style/Theme.JSTheme"/>
        <uses-sdk android:targetSdkVersion="14"/>
    </manifest>
</android>

And when I restore back the lines above to same

Then the app gets compiled and everything works.

Am I doing something wrong?

And when I restore back the lines above to same

<android xmlns:android="http://schemas.android.com/apk/res/android" />

Then the app gets compiled and everything works.

Am I doing something wrong?

回答1:

  1. Make sure that the JSTheme.xml file is in the correct directory and format --> The correct directory for android themes is

platform/android/res/values/JSTheme.xml

And the correct format should be like

<!-- Works for Titanium SDK 3.3.0 and later -->
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="LightDarkBar" parent="Theme.AppCompat.Light.DarkActionBar"/>
    <style name="Light" parent="Theme.AppCompat.Light"/>
    <style name="Dark" parent="Theme.AppCompat"/>
</resources>

For more details about custom themes, check this link.

  1. If this doesn't work, try this code in the tiapp.xml:

    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <application android:theme="@style/Theme.JSTheme"/>
        </manifest>
    </android>
    


回答2:

Titanium doesn't support Holo themes anymore, make sure that you select 'appcompat' on the compatibility section of Android-holo-colors.com

Also, i found it best to use only lower case letters on the website and then capitalise the first letter in tiapp.xml

e.g. on Android-holo-colors.com name it: jstheme

then in tiapp.xml: <application android:theme="@style/Theme.Jstheme"/>