离子 - 应用程序在初始屏幕上挂起



我的离子应用程序挂在启动屏幕上 - 它工作正常,然后我添加了一些代码,然后去测试,它被卡住了。

到了这个地步:

------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[  0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb)     platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
  Platform: remote-ios
 Connected: no
  SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb)     target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb)     script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb)     target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb)     command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb)     command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb)     command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb)     command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb)     command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb)     connect
(lldb)     run
success
(lldb)     safequit
Process 7681 detached

deviceready信息永远不会到来。

我做的一件相关的事情是,当我在构建或 ionic 要求我将ios-deploy从 1.9.1 升级到 1.9.2 时。我认为这在我这样做之后就开始发生了。我尝试恢复到 1.9.1,但它不会让我:

ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **

The following build commands failed:
    Ld build/Release/ios-deploy normal x86_64
(1 failure)
npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/Cellar/node/7.7.3/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy@1.9.1"
npm ERR! node v7.7.3
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! ios-deploy@1.9.1 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR! 
npm ERR! Failed at the ios-deploy@1.9.1 preinstall script './src/scripts/check_reqs.js && xcodebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./src/scripts/check_reqs.js && xcodebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ios-deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /Users/eamonwhite/Downloads/ionicmane-master/npm-debug.log

这可能不是问题所在。我真的可以使用一些帮助,我已经接近截止日期了。

更新

当我尝试运行xcode时,同样的事情会发生,但xcode给出以下错误:

2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.

更新

我想出了导致这种情况的原因 - 这很livereload - 如果我在没有它的情况下运行它,它很好......但我有点需要它来发展。

我没有在手机上启用wifi,因此无法连接到ionic

根据我的经验,我们遇到了同样的问题deviceready这个问题从未显示在我们的控制台日志中,最可能的情况是 Cordova 插件不一致 您可以做的一件事是重新安装插件并尝试删除您的平台文件夹并使用 npm cache clean 进行干净的构建。

更新:

根据您的更新,您如何运行您的ios应用程序?

是否使用如下所示的-l -c命令运行应用:

ionic run ios -l -c

如果是这种情况,您可能会注意到此命令更改了config.xml文件中的一行:

//从 <content src="index.html"/>

//自 <content src="localhost//192.1.168.0:8000" original-src="index.html"/>

因此,将其改回<content src="index.html"/>可能会解决问题。

解决方案 2:

您可能需要通过以下方式将本地主机列入白名单:

<allow-navigation href="http://localhost:8100/*"/>

我最好的猜测是你的iPhone还没有为iOS11准备调试器。首次在新的iOS版本上运行应用时,它会这样做。您必须使用XCode打开并运行一次项目,然后您应该没问题。还请确保您拥有最新版本的 cordova-ios,这是4.5.1(检查config.xml中的 <engine name=ios"> 标签)。

检查您的配置中是否有以下标签.xml

<allow-navigation href="*"/>

您还可以检查这是否仅在iOS或Android中观察到。

在 Ionic 4 中遇到了这个问题。 添加iOS平台后,运行以下命令有效:

 ionic cordova prepare ios

最新更新