我刚刚升级了Appcelerator Studio并将我的项目从Titanium SDK v5.0.2.GA更新到5.3.0.GA,它在Android上运行正常(虽然我不得不从ProgressBar中删除一个颜色属性所以它正确渲染),但在iOS上显示红色错误屏幕,显示以下消息...
无法找到模块:ti.cloudpush for architecture:armv7
控制台报告以下内容......
[INFO]:应用已启动[错误]:脚本错误无法找到模块: ti.cloudpush for architecture:armv7
[错误]:脚本错误模块 " UI /普通/登录窗口"未能留下有效的出口对象
[错误]:脚本错误模块"通用/服务"没有留下有效的 出口对象
[错误]:ErrorController启动。中止显示模态控制器
[错误]: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>
答案 0 :(得分:1)
正如你提到的那样&#34;但在iOS上它显示一个红色错误屏幕,显示以下消息......&#34;,.....
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');
}
如果没有帮助,请分享您调用此模块的一些代码。