【发布时间】:2019-08-29 02:53:06
【问题描述】:
我刚刚将我的 MacOS 环境从 Ionic CLI 1.7.14 升级到 v5.2.6。这也需要我将 NodeJS 升级到 v10.16.3。我有几个问题,但其中一个是当我构建应用程序时,platforms/ios/build 目录没有被创建。
但是,我可以将应用程序直接从 Xcode 部署到我的测试手机 - 但它的所有内容都不稳定、缺少图像、后端服务器 api 调用无法正常工作、应用程序中指向其他应用程序页面的 URL 链接无法正常工作。即使从 Xcode 部署后仍然没有构建目录。同样,Safari 网络检查器会打开一个空白窗口...没有元素,控制台信息,什么都没有。
我的构建中似乎没有任何错误。下面是 --verbose 输出:
/users/macknife/dev/MyApp> ionic cordova build ios --buildFlag='-UserModernBuildSystem=0' --verbose
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'build', 'ios' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, buildFlag: '-UserModernBuildSystem=0', project: null, '--': [] } +5ms
ionic:lib:project Project type from config: Ionic 1 (ionic1) +0ms
ionic:lib:project Project details: { configPath: '/Users/macknife/dev/MyApp/ionic.config.json', errors: [], context: 'app', type: 'ionic1' } +0ms
ionic Context: { binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic', execPath: '/Users/macknife/dev/MyApp', version: '5.2.6' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/macknife/dev/MyApp/config.xml', package.json: '/Users/macknife/dev/MyApp/package.json') +0ms
ionic:lib:build build options: { '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'ios',
ionic:lib:build project: undefined,
ionic:lib:build verbose: false,
ionic:lib:build type: 'ionic1' } +0ms
ionic:lib:telemetry Sending telemetry for command: 'ionic cordova build' [ 'ios',
ionic:lib:telemetry '--verbose',
ionic:lib:telemetry '--interactive',
ionic:lib:telemetry '--color',
ionic:lib:telemetry '--build-flag=-UserModernBuildSystem=0' ] +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +12ms
> ionic-v1 build
ionic:v1-toolkit:lib:gulp Using gulpfile: /Users/macknife/dev/MyApp/gulpfile.js +0ms
ionic:v1-toolkit:lib:gulp Using gulp: /Users/macknife/dev/MyApp/node_modules/gulp/index.js +2ms
ionic:v1-toolkit:lib:gulp Loaded gulp tasks: { default: { fn: [Function], dep: [ 'sass' ], name: 'default' }, sass: { fn: [Function], dep: [], name: 'sass' }, watch: { fn: [Function], dep: [ 'sass' ], name: 'watch' } } +957ms
[10:25:49] Invoking sass gulp task.
ionic:lib:hooks Looking for ionic:build:after npm script. +3s
> cordova build ios --verbose
No scripts found for hook "before_build".
Executing script found in plugin cordova-custom-config for hook "before_prepare": plugins/cordova-custom-config/hooks/restoreBackups.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Skipping auto-restore of config file backup(s)
Executing script found in plugin cordova-custom-config for hook "before_prepare": plugins/cordova-custom-config/hooks/applyCustomConfig.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Finished applying platform config
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform ios
Checking for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in ios platform
No differences found between plugins added to project and installed in ios platform. Continuing...
Generating platform-specific config.xml from defaults for iOS at /users/macknife/dev/MyApp/platforms/ios/MyApp/config.xml
Merging project's config.xml into platform-specific iOS config.xml
Merging and updating files from [www, platforms/ios/platform_www] to platforms/ios/www
copy www/css/ionic.app.css platforms/ios/www/css/ionic.app.css (updated file)
copy www/css/ionic.app.min.css platforms/ios/www/css/ionic.app.min.css (updated file)
copy www/index.html platforms/ios/www/index.html (updated file)
Current launch storyboard CDVLaunchScreen
Not changing launch storyboard setting in info plist.
Wrote out iOS Bundle Version "0.2.90" to /users/macknife/dev/MyApp/platforms/ios/MyApp/MyApp-Info.plist
No need to update build settings for launch storyboard support.
Set IPHONEOS_DEPLOYMENT_TARGET to "9.3".
Did not update build settings for launch storyboard support.
iOS Product Name has not changed (still "MyApp")
Updating icons at platforms/ios/MyApp/Images.xcassets/AppIcon.appiconset/
Updating splash screens at platforms/ios/MyApp/Images.xcassets/LaunchImage.launchimage/
Updating launch storyboard images at platforms/ios/MyApp/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
Executing script found in hooks directory for hook "after_prepare": hooks/after_prepare/010_add_platform_class.js
Running command: /users/macknife/dev/MyApp/hooks/after_prepare/010_add_platform_class.js /users/macknife/dev/MyApp
add to body class: platform-ios
Command finished with error code 0: /users/macknife/dev/MyApp/hooks/after_prepare/010_add_platform_class.js /users/macknife/dev/MyApp
Executing script found in plugin cordova-custom-config for hook "after_prepare": plugins/cordova-custom-config/hooks/applyCustomConfig.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Finished applying platform config
Executing script found in plugin cordova-plugin-facebook4 for hook "after_prepare": plugins/cordova-plugin-facebook4/scripts/after_prepare.js
Executing script found in plugin cordova-plugin-firebasex for hook "after_prepare": plugins/cordova-plugin-firebasex/scripts/after_prepare.js
Preparing Firebase on iOS
Ionic:
Ionic CLI : 5.2.6 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.0.0
@ionic/v1-toolkit : 1.0.22
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 32 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v10.16.3 (/usr/local/bin/node)
npm : 6.11.2
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61
=======================
凭直觉,我删除了自动安装的Cordova-plugin-ionic-webview(在构建新应用程序时,这似乎是 Ionic CLI 的标准配置)并返回使用我以前的 web view-plus(是的,很旧,但它在 CLI 大升级之前我一直在使用的东西——它工作得很好)。我尝试从控制台再次构建,它没有任何错误,但又没有 platform/ios/build 文件夹 - 但是,我可以从 Xcode 干净地部署我的应用程序 - 所有不稳定的东西都消失了 - 我的应用程序正在运行并且我可以管理应用程序再次来自 Safari 网络检查器。关于 ionic-web 视图的某些东西一定会导致所有的问题 - 但仍然不能解释构建问题。
【问题讨论】:
标签: ios cordova ionic-framework gulp-sass