Search code examples
iosappceleratorappcelerator-titanium

How to fix "couldn't find module: ti.cloudpush for architecture: armv7" (Appcelerator Titanium)


I've just upgraded Appcelerator Studio and updated my project from Titanium SDK v5.0.2.GA to 5.3.0.GA, it works fine on Android (although I had to remove a color property from the ProgressBar so it rendered correctly), but on iOS it showed a red error screen with the following message...

Couldn't find module: ti.cloudpush for architecture: armv7

The Console reports the following...

[INFO] : App started [ERROR] : Script Error Couldn't find module: ti.cloudpush for architecture: armv7

[ERROR] : Script Error Module "ui/common/LoginWindow" failed to leave a valid exports object

[ERROR] : Script Error Module "common/Services" failed to leave a valid exports object

[ERROR] : ErrorController is up. ABORTING showing of modal controller

[ERROR] : ErrorController is up. ABORTING showing of modal controller

A quick google search implied that I needed to change some manifest files and recompile the module - but it's not a module I wrote, it's provided by Appcelerator (Titanium).

Could someone please guide me to what's required to fix this problem?

Reverting to 5.0.2.GA - also blows up, so perhaps something in the Appcelerator Studio has broken something, or Applie/XCode has some new requirements?

I'm deploying via USB - no AppStore at this stage.

My project has the following (note many of the UIRequiredDeviceCapabilities are commented out, no changes here for many months)...

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

Solution

  • As you mentioned that "but on iOS it showed a red error screen with the following message...",.....

    The ti.cloudpush module is only for Android as you can also see it from these lines in tiapp.xml:

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

    Now, the problem could be that you have not put a check on OS wherever you are requiring the cloudpush module.

    I suggest you to look into that code where you are calling it by something like this :

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

    So, to make it work, use this code:

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

    If it does not help, then share some code where you are calling this module.