Error building Appcelerator project: Failed to package application: error: Error retrieving parent for item

220 Views Asked by At

I am trying to build an application created by another developer. I have imported the project and updated the dependencies to the latest version. When I try to run, I am getting the following error:

[ERROR] :  Failed to package application:
[ERROR] :  
[ERROR] :  (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
[ERROR] :      (skipping file '.liveviewapp.js' due to ANDROID_AAPT_IGNORE pattern '.*')
[ERROR] :  E:\Projects\New_workspace\app\build\android\res\values\theme.xml:28: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.skitanium'.
[ERROR] Application Installer abnormal process termination. Process exit value was 1

The themes.xml file has the following content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.skitanium" parent="@style/Theme.AppCompat.Light">
        <item name="editTextStyle">@style/editText</item>
        <item name="android:windowBackground">@drawable/background</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <!-- AppCompat Compatibility -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    <!-- Text fields -->
    <style name="editText" parent="@android:style/Widget.EditText">
        <item name="android:textCursorDrawable">@null</item>   
        <item name="android:textColor">#000000</item>
        <item name="android:paddingTop">0dp</item>
        <item name="android:paddingBottom">0dp</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:layout_width">wrap_content</item>
    </style>
</resources>

Here are the versions I am using:

  <manifest android:versionCode="8" android:versionName="1.1.7">
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28"/>

Titanium SDK Version: 7.5.0.GA

Axway Appcelerator Studio, build: 5.1.1.201809051655

Can someone guide me what are the possible reasons for this error?

1

There are 1 best solutions below

9
miga On

Please check the documentation at: https://wiki.appcelerator.org/display/guides2/Android+Themes#AndroidThemes-Androidthemes

You are not allow to name your theme theme.xml. That will override the internal theme. So if you rename your file it should work.

Also please try <style name="Theme.skitanium" parent="Theme.AppCompat.Light"> without the @style. There is an example at https://docs.axway.com/bundle/Titanium_SDK_allOS_en/page/android_themes.html that uses it without too