ios - 如何在 ios 中为 nativescript 应用程序调试构建失败?
问题描述
我只是跑步tns run ios --emulator
,我得到了这个:
/Users/me/Desktop/proj/projfront/App/platforms/ios/Pods/MBProgressHUD/MBProgressHUD.m:87:34: error: no known class method for selector
'labelColor'
_contentColor = [[UIColor labelColor] colorWithAlphaComponent:0.7f];
^~~~
/Users/me/Desktop/proj/projfront/App/platforms/ios/Pods/MBProgressHUD/MBProgressHUD.m:378:101: error: use of undeclared identifier
'UIActivityIndicatorViewStyleLarge'
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
^
/Users/me/Desktop/proj/projfront/App/platforms/ios/Pods/MBProgressHUD/MBProgressHUD.m:1065:32: error: use of undeclared identifier
'UIBlurEffectStyleSystemThickMaterial'
_blurEffectStyle = UIBlurEffectStyleSystemThickMaterial;
^
3 errors generated.
note: Using new build systemnote: Planning buildnote: Constructing build description
* BUILD FAILED *
Unable to apply changes on device: 96EBA70E-38D5-4C6A-B30B-21BECF697C9C. Error is: Command xcodebuild failed with exit code 65.
我不知道如何调试这个。它在 Android 上构建得很好。 这是我的 package.json:
{
"nativescript": {
"templateVersion": "v2",
"tns-android": {
"version": "6.0.0"
},
"tns-ios": {
"version": "6.0.1"
}
},
"dependencies": {
"@nativescript/theme": "^2.2.1",
"@nstudio/nativescript-cardview": "^1.0.0",
"@nstudio/nativescript-checkbox": "^1.0.0",
"@nstudio/nativescript-floatingactionbutton": "^2.0.0",
"@nstudio/nativescript-loading-indicator": "^3.0.1",
"axios": "^0.19.2",
"nativescript-exoplayer": "^4.0.2",
"nativescript-iqkeyboardmanager": "^1.5.1",
"nativescript-masked-text-field": "^4.0.3",
"nativescript-plugin-firebase": "^10.3.3",
"nativescript-social-share": "^1.6.0",
"nativescript-ui-autocomplete": "^6.0.0",
"nativescript-vue": "^2.4.0",
"tns-core-modules": "^6.0.0",
"vuex": "^3.1.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.2",
"nativescript-dev-webpack": "^1.0.0",
"nativescript-vue-template-compiler": "^2.0.0",
"nativescript-worker-loader": "~0.9.0",
"node-sass": "^4.9.2",
"vue-loader": "^15.4.0"
}
}
解决方案
这labelColor
是 iOS 13 引入的新属性。您需要 XCode 11 才能为 iOS 13.x 及更高版本构建。也就是说,其中一个插件正在引入一个名为 MBProgressHUD 的 pod。该 pod 正在使用最新的 iOS API。但是您的构建很可能会失败,因为它是使用 XCode 10.x 或更低版本构建的。要解决此问题,请尝试使用 XCode 11 和 latest tns-ios
(6.3.x 及更高版本)+ latest 构建tns-core-modules
。
推荐阅读
- java - 如何总结年代?
- javascript - 修复 Rails 应用程序中的“Uncaught ReferenceError: Highcharts is not defined”
- intellij-idea - 如何使用 IntelliJ IDEA 跳过分号?
- jquery - 如何在同一个 \DB::statement() 中使用多个数据库连接
- angular - 如何从外部元素访问相应的组件?
- javascript - 隔离导轨插件上的远程链接不起作用
- java - 尽管有 OpenJDK 的 GNU GPL v2,为什么公司可以为其 JDK 版本收费?
- haskell - 基于 `fmap` 的 `<*>` 的实现对于 Maybe applicative 是特殊的还是可以推广到其他 applicative?
- python - 在 Keras 上使用回调 Tensorboard 时出现 AttributeError:“模型”对象没有属性“run_eagerly”
- apache-spark - Spark加载大型镶木地板文件很长的垃圾收集时间