Reputation: 360
I tried to change theme for Android by following the link in Appcelerator: http://docs.appcelerator.com/titanium/latest/#!/guide/Android_Themes
It’s giving me below error:
[INFO] : Generating path-to-projectfolder\build\android\res\values\theme.xml
[INFO] : Writing unmerged custom AndroidManifest.xml
[INFO] : Packaging application:
[ERROR] : Failed to package application:
[ERROR] Application Installer abnormal process termination. Process exit value was 1
Please mark although I have set my theme name as apptheme, it's still generating theme.xml.
Below are some addtionald details:
Application type: Mobile Android
Titanium SDK: 3.2.3.Beta
Platform & version: Android minSdkVersion="13" targetSdkVersion="14"
Titanium Studio: 3.2.1.201402041146
Device: Samsung SIII
Please let me know where I am doing the mistake and guide me accordingly.
Upvotes: 1
Views: 2925
Reputation: 1992
Those guys that wrote the docs must be not test what they've written!
This xml come from http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Themes
<!-- Works for Titanium SDK 3.2.x and earlier when built against Android 4.0x/API Level 14 -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Available for Android 4.0.x/API Level 14 and later -->
<style name="LightDarkBar" parent="@android:style/Theme.Holo.Light.DarkActionBar"/>
<!-- Available for Android 3.0.x/API Level 11 and later -->
<style name="Light" parent="@android:style/Theme.Holo.Light"/>
<style name="Dark" parent="@android:style/Theme.Holo"/>
<!-- Available for all Android versions -->
<style name="OldLight" parent="@android:style/Theme.Light"/>
<style name="OldDark" parent="@android:style/Theme.Black"/>
</resources>
using aapt ver 19 above xml gave me this:
builtin_themes.xml:2: error: Error parsing XML: XML or text declaration not at start of entity
So, the solution is change above xml to
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Available for Android 4.0.x/API Level 14 and later -->
<style name="LightDarkBar" parent="@android:style/Theme.Holo.Light.DarkActionBar"/>
<!-- Available for Android 3.0.x/API Level 11 and later -->
<style name="Light" parent="@android:style/Theme.Holo.Light"/>
<style name="Dark" parent="@android:style/Theme.Holo"/>
<!-- Available for all Android versions -->
<style name="OldLight" parent="@android:style/Theme.Light"/>
<style name="OldDark" parent="@android:style/Theme.Black"/>
</resources>
Please note that I removed any pre-trailing xml tags before
<?xml version="1.0" encoding="utf-8"?>
Upvotes: 2
Reputation: 360
Hey I am able to resolve it.
Details steps for customizing Android theme in Appcelerator:
Upto this it's alright and below are the important steps you must follow so as to avoid any build error:
Now goto tiapp.xml and paste the below code inside and note down that the theme name will be MyTheme here:
<manifest>
<!-- Replace AppThemeName with the name of your theme -->
<application android:theme="@style/MyTheme"/>
<uses-sdk android:minSdkVersion="13" android:targetSdkVersion="14"/>
</manifest>
Upvotes: 1