【问题标题】:Error building Appcelerator project: Failed to package application: error: Error retrieving parent for item构建 Appcelerator 项目时出错:无法打包应用程序:错误:检索项目的父项时出错
【发布时间】:2019-02-07 06:46:51
【问题描述】:

我正在尝试构建由其他开发人员创建的应用程序。我已导入项目并将依赖项更新到最新版本。当我尝试运行时,出现以下错误:

[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

themes.xml文件有以下内容:

<?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>

这是我正在使用的版本:

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

Titanium SDK 版本:7.5.0.GA

Axway Appcelerator Studio,内部版本:5.1.1.201809051655

谁能指导我这个错误的可能原因是什么?

【问题讨论】:

    标签: titanium appcelerator appcelerator-titanium appcelerator-mobile appcelerator-studio


    【解决方案1】:

    请查看文档:https://wiki.appcelerator.org/display/guides2/Android+Themes#AndroidThemes-Androidthemes

    您不能将您的主题命名为theme.xml。这将覆盖内部主题。因此,如果您重命名文件,它应该可以工作。

    也请尝试不带@style&lt;style name="Theme.skitanium" parent="Theme.AppCompat.Light"&gt;https://docs.axway.com/bundle/Titanium_SDK_allOS_en/page/android_themes.html 有一个例子,它不用太使用它

    【讨论】:

    • 您好,感谢您的更新。其实是themes.xml
    • 啊好的。请尝试&lt;style name="Theme.skitanium" parent="Theme.AppCompat.Light"&gt;
    • 不幸的是,没有任何效果! ? 如果我直接在tiapp.xml 中指定@style/Theme.AppCompat.Light,它将成功编译。但是对于自定义主题,它不起作用。
    • 你在哪里设置主题?在您的 TSS 文件中?你有@style/Theme.skitanium的地方只需要Theme.skitanium
    • 将其设置在tiapp.xml 文件中。在没有 @style 的情况下尝试过,但也没有用
    猜你喜欢
    • 2016-08-15
    • 1970-01-01
    • 2016-03-04
    • 2015-02-10
    • 1970-01-01
    • 2016-07-23
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多