[关闭]
@Wahson 2017-01-07T23:33:40.000000Z 字数 3628 阅读 1971

App开发问题整理

前端技术


1、ios版发布app store 时,itunes回复出错邮件:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

解决方案:
添加 cordova-plugin-media-capture 插件,并在app/config.xml中添加配置:

  1. <plugin name="cordova-plugin-media-capture" source="npm" spec="*">
  2. <variable name="CAMERA_USAGE_DESCRIPTION" value="App would like to access the camera." />
  3. <variable name="MICROPHONE_USAGE_DESCRIPTION" value="App would like to access the microphone." />
  4. <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
  5. </plugin>

value中的值可能不生效,可以自行在xcode里修改app's Info.plist中相应的值。
此处输入图片的描述
然后重新上传。

链接


2、安装jpush插件后,build ios报错:

  1. Undefined symbols for architecture i386:
  2. "_OBJC_CLASS_$_JPUSHRegisterEntity", referenced from:
  3. objc-class-ref in AppDelegate+JPush.o
  4. "_kJPFNetworkDidReceiveMessageNotification", referenced from:
  5. -[JPushPlugin initPlugin] in JPushPlugin.o
  6. "_OBJC_CLASS_$_JPushNotificationIdentifier", referenced from:
  7. objc-class-ref in JPushPlugin.o
  8. "_OBJC_CLASS_$_JPUSHService", referenced from:
  9. objc-class-ref in JPushPlugin.o
  10. objc-class-ref in AppDelegate+JPush.o
  11. ld: symbol(s) not found for architecture i386
  12. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  13. ** BUILD FAILED **
  14. The following build commands failed:
  15. Ld build/emulator/快塑网.app/快塑网 normal i386
  16. (1 failure)
  17. Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/wahsonleung/IdeaProjects/isuwang/isuwang-app/app/platforms/ios/cordova/build-debug.xcconfig,-project,快塑网.xcodeproj,AR=i386,-target,快塑网,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/wahsonleung/IdeaProjects/isuwang/isuwang-app/app/platforms/ios/build/emulatoHARED_PRECOMPS_DIR=/Users/wahsonleung/IdeaProjects/isuwang/isuwang-app/app/platforms/ios/build/sharedpch

解决办法:执行如下命令

  1. $ cordova platform update ios

3、只允许app在iphone上跑,不允许ipad
app/config.xml中添加如下配置:

  1. <platform name="ios">
  2. <preference name="target-device" value="handset" />
  3. </platform>

4、配置deployment target
app/config.xml中添加如下配置:

  1. <platform name="ios">
  2. <preference name="deployment-target" value="7.0" />
  3. </platform>

5、Remote notifications

在启动程序时,日志里面打印了:You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.这句话的意思是我们在UIApplicationDelegate中实现了application:didReceiveRemoteNotification:fetchCompletionHandler:方法,但没有在Info.plist中的UIBackgroundModes添加remote-notification。之前做这个推送的同事说这个提示没有关系,一直都有这句提示的,而且我们的推送功能一直是正常的。

http://www.jianshu.com/p/9a25418ab84e


6、cordova build ios --release 执行出错
错误信息:

  1. Check dependencies
  2. 快塑网 has conflicting provisioning settings. 快塑网 is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the coning identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.
  3. Code signing is required for product type 'Application' in SDK 'iOS 10.2'
  4. ** ARCHIVE FAILED **

原因分析:

解决办法:


7、QuotaExceededError : The quota has been exceeded
原因分析:localStorage.setItem 时,达到了localstorage的存储上限。


8、使用xcode archives时出错

  1. 快塑网 is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.

解决办法:https://forums.developer.apple.com/thread/52222


9、jpush ios系统 appkey无法写入PushConfig.plist

使用如下命令添加jpush插件,但是在ios中PushConfig.plist中的API_KEY没有替换成命令中指定的,继续使用了默认的值,导致应用启动时获得的registrationid无效。
  1. cordova plugin add jpush-phonegap-plugin --variable API_KEY=${API_KEY}

原因分析:估计是jpush插件的bug
解决办法:没有太多办法,暂时的做法直接把PushConfig.plist里的值改成正确的值。


添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注