【问题标题】:How to fix "couldn't find module: ti.cloudpush for architecture: armv7" (Appcelerator Titanium)如何修复“找不到模块:ti.cloudpush for architecture: armv7”(Appcelerator Titanium)
【发布时间】:2016-06-06 21:59:08
【问题描述】:

我刚刚升级了 Appcelerator Studio 并将我的项目从 Titanium SDK v5.0.2.GA 更新到 5.3.0.GA,它在 Android 上运行良好(尽管我必须从 ProgressBar 中删除一个颜色属性以便它正确呈现),但在 iOS 上显示红色错误屏幕并显示以下消息...

找不到模块:ti.cloudpush 用于架构:armv7

控制台报告以下...

[INFO]:应用程序已启动 [ERROR]:脚本错误找不到模块: ti.cloudpush 架构:armv7

[ERROR] : 脚本错误模块 “ui/common/LoginWindow”未能留下有效的导出对象

[ERROR] : 脚本错误模块“common/Services”未能留下有效的 导出对象

[ERROR] : ErrorController 已启动。模态控制器显示中止

[ERROR] : ErrorController 已启动。中止显示 模态控制器

快速的谷歌搜索暗示我需要更改一些清单文件并重新编译模块 - 但这不是我编写的模块,它是由 Appcelerator (Titanium) 提供的。

有人可以指导我解决这个问题需要什么吗?

恢复到 5.0.2.GA - 也崩溃了,所以可能是 Appcelerator Studio 中的某些东西损坏了某些东西,或者 Applie/XCode 有一些新要求?

我正在通过 USB 进行部署——现阶段没有 AppStore。

我的项目有以下内容(注意许多 UIRequiredDeviceCapabilities 已被注释掉,这里已经好几个月没有变化了)...

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <id>com.devology.****.app</id>
    <name>****</name>
    <version>1.37</version>
    <publisher>*****</publisher>
    <url>https://www.****.com</url>
    <description>****</description>
    <copyright>****</copyright>
    <icon>appicon.png</icon>
    <!-- Android = appicon.png -->
    <!--    <fullscreen>false</fullscreen><navbar-hidden>false</navbar-hidden>
   -->
    <analytics>true</analytics>
    <guid>****</guid>
    <property name="ti.ui.defaultunit" type="string">dp</property>
    <ios>
        <min-ios-ver>6.0</min-ios-ver>
        <!-- 6.0 would exclude iPad 1-->
        <!-- 7.0 is minimum version for armv7s-->
        <plist>
            <dict>
                <key>NSLocationAlwaysUsageDescription</key>
                <string>****</string>
                <key>NSLocationWhenInUseUsageDescription</key>
                <string>****</string>
                <key>UISupportedInterfaceOrientations~iphone</key>
                <array>
                    <string>UIInterfaceOrientationPortrait</string>
                    <string>UIInterfaceOrientationPortraitUpsideDown</string>
                </array>
                <!--
                <key>UISupportedInterfaceOrientations~ipad</key><array><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationPortraitUpsideDown</string><string>UIInterfaceOrientationLandscapeLeft</string><string>UIInterfaceOrientationLandscapeRight</string></array>
                -->
                <key>UIRequiresPersistentWiFi</key>
                <!-- specifies whether the app requires a Wi-Fi connection. iOS maintains the active Wi-Fi connection open while the app is running. -->
                <false/>
                <key>UIPrerenderedIcon</key>
                <false/>
                <key>UIStatusBarHidden</key>
                <true/>
                <key>beta-reports-active</key>
                <true/>
                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleDefault</string>
                <key>UIBackgroundModes</key>
                <array>
                    <string>location</string>
                    <!--
                        Causes rejection by Apple, but shouldn't need backgrounded sound
                        because we use notifications to do this
                        <string>audio</string>
                    -->
                </array>
                <key>UIRequiredDeviceCapabilities</key>
                <array>
                    <!--<string>armv7</string>-->
                    <!--iPhone 3GS, iPhone 4, iPhone 4S, iPod 3G/4G/5G, iPad, iPad 2, iPad 3, iPad Mini -->
                    <!--<string>armv7s</string>-->
                    <!-- iPhone 5, iPad 4 -->
                    <string>gps</string>
                    <!-- You should require GPS only if your app needs location data more accurate than the cellular or Wi-fi radios might otherwise provide. -->
                    <string>location-services</string>
                    <!-- if you include 'gps' key, you should also include the location-services key -->
                    <!--<string>sms</string> -->
                    <!-- Include this key if your app requires (or specifically prohibits) the presence of the Messages app. You might require this feature if your app opens URLs with the sms scheme. -->
                    <!--<string>telephony</string> -->
                    <!-- Include this key if your app requires (or specifically prohibits) the presence of the Phone app. You might require this feature if your app opens URLs with the tel scheme. -->
                    <!--<string>wifi</string>-->
                    <!-- Include this key if your app requires (or specifically prohibits) access to the networking features of the device. -->
                </array>
            </dict>
        </plist>
    </ios>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest android:versionCode="37" android:versionName="1.37">
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.VIBRATE"/>
            <uses-permission android:name="android.permission.SOUND"/>
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
        </manifest>
        <services>
            <service type="interval" url="common/androidBackgroundService.js"/>
        </services>
    </android>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules>
        <module platform="android">ti.cloudpush</module>
        <module platform="commonjs">ti.cloud</module>
    </modules>
    <deployment-targets>
        <target device="blackberry">false</target>
        <target device="android">true</target>
        <target device="ipad">false</target>
        <target device="iphone">true</target>
        <target device="mobileweb">false</target>
    </deployment-targets>
    <sdk-version>5.0.2.GA</sdk-version>
....
</ti:app>

【问题讨论】:

    标签: ios appcelerator appcelerator-titanium


    【解决方案1】:

    正如你提到的“但在 iOS 上它显示了一个带有以下消息的红色错误屏幕......”,.....

    ti.cloudpush 模块仅适用于 Android,您也可以从 tiapp.xml 中的这些行中看到它:

    <modules>
        <module platform="android">ti.cloudpush</module>
        <module platform="commonjs">ti.cloud</module>
    </modules>
    

    现在,问题可能是您在需要 cloudpush 模块的任何地方都没有检查操作系统。

    我建议您通过以下方式查看您调用它的代码:

    var CloudPush = require('ti.cloudpush');
    

    因此,要使其正常工作,请使用以下代码:

    var CloudPush;
    
    if (OS_ANDROID) {
       CloudPush = require('ti.cloudpush');
    }
    

    如果没有帮助,请在调用此模块的地方分享一些代码。

    【讨论】:

    • 谢谢@Prashant-Saini - 我讨厌我做一些愚蠢的事情,不幸的是,我在 6 周前开始了 Android 更改,最近恢复了,忘记了自从添加 CloudPush 后我没有在 iOS 上运行它。我已经仔细地将 if 条件放在除了 require 块之外的所有东西上。谢谢!!它表明当您升级 Appcelerator Titanium 和 SDK 时,很容易认为它们破坏了某些东西 ;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-17
    • 1970-01-01
    • 2020-12-18
    • 2019-10-19
    相关资源
    最近更新 更多