Failed to package application when Android Manifest Portion is changed to

青春壹個敷衍的年華 提交于 2020-01-07 01:24:12

问题


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"/>



来源:https://stackoverflow.com/questions/29591310/failed-to-package-application-when-android-manifest-portion-is-changed-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!