在流星科尔多瓦建造什么导致死亡白屏?

时间:2018-05-30 13:59:00

标签: angular cordova meteor

当我在Meteor中为Android构建时,我正在使用白屏死机对Android应用进行故障排除。它适用于在开发时,部署的服务器和移动浏览器上显示的浏览器。

应用程序是使用Angular在MeteorJS中构建的。版本是Meteor 1.6.1.1和angular:angular@1.5.3_1。

控制台中的错误消息如下:

=> Started proxy.                             
=> Started MongoDB.                           

WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on the same network, and that the network configuration allows
             clients to talk to each other (no client isolation).

=> Started your app.                          
=> App running at: http://localhost:3000/     
=> Started app on Android Device.             
I20180530-14:46:50.104(1)? 05-30 14:46:44.712 31175 31175 I chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20180530-14:46:50.150(1)? 05-30 14:46:45.219 31320 31320 I CordovaLog: Changing log level to DEBUG(3)
I20180530-14:46:50.151(1)? 05-30 14:46:45.457 31320 31320 I chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20180530-14:46:50.151(1)? 05-30 14:46:45.579 31320 31387 E chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
I20180530-14:46:50.152(1)? 05-30 14:46:46.560 31320 31320 I MeteorWebApp: Serving asset bundle with version: 7990da69bb2fd9d114781c4ced3482f74c30885b
I20180530-14:46:50.152(1)? 05-30 14:46:46.785 31350 31401 I chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I20180530-14:46:50.153(1)? 05-30 14:46:47.285 31350 31401 E chromium: [ERROR:BudgetService.cpp(160)] Unable to connect to the Mojo BudgetService.
I20180530-14:46:50.153(1)? 05-30 14:46:47.781 31320 31320 I chromium: [INFO:CONSOLE(44922)] "WARNING: Tried to load AngularJS more than once.", source: http://localhost:12880/packages/modules.js?hash=b66baa905179fb6487e6ccaa81cbb12b2e53c95c (44922)

的软件包:

meteor-base@1.3.0             # Packages every Meteor app needs to have
mobile-experience@1.0.5       # Packages for a great mobile UX
mongo@1.4.2                   # The database Meteor supports right now
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.1.3                 # Meteor's client-side reactive programming library

standard-minifier-css@1.4.0   # CSS minifier run for production mode
standard-minifier-js@2.3.1    # JS minifier run for production mode
es5-shim@4.7.0                # ECMAScript 5 compatibility for older browsers
ecmascript@0.10.6              # Enable ECMAScript2015+ syntax in app code
shell-server@0.3.1            # Server-side component of the `meteor shell` command

autopublish@1.0.7             # Publish all data to the clients (for prototyping)
insecure@1.0.7                # Allow all DB writes from clients (for prototyping)
angular:angular@1.3.0
jquery
angular:angular-route
angular:angular-sanitize
angular:angular-animate
d3js:d3
urigo:static-templates
fourseven:scss
twbs:bootstrap
browser-policy

Cordova插件:

cordova-plugin-meteor-webapp@1.4.1
cordova-plugin-splashscreen@4.1.0
cordova-plugin-statusbar@2.3.0
cordova-plugin-wkwebview-engine@https://github.com/apache/cordova-plugin-wkwebview-engine.git#815ed0741b9ae30b343d6429bd8ff2ad37ec5790
cordova-plugin-wkwebviewxhrfix@https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix.git#593eb98a155bd1f970276222be8c6bfa757568f4

@Swoox建议我在chrome中运行dev工具,它会产生这些错误:

WARNING: Tried to load AngularJS more than once.
app.js:510 imports7999 start
app.js:510 all imports complete
app.js:510 Meteor Startup!
app.js:510 STRIPPED-DOWN 07 - app create command sent
app.js:510 Process Line in Action animations enabled

3 个答案:

答案 0 :(得分:1)

您似乎在本地服务器上运行Meteor。当您在本地服务器上运行应用程序时,您的服务器和客户端(手机上的应用程序)必须位于同一WiFi网络上,并且网络配置不应阻止客户端访问服务器。

如果您需要移动应用程序连接到其他服务器,则可以使用--mobile-server选项指定地址。

对于制作,您需要设置ROOT_URL的环境变量,这些变量将是您可以通过互联网访问的应用的网址(或域),以及MONGO_URL,它将是您MongoDB部署的网址。

相关示例;

  1. meteor run android-device - >服务器和客户端必须位于同一个WiFi网络上
  2. meteor run android-device --mobile-server your_app.herokuapp.com - > --mobile-server param用于定义Internet上可访问的服务器URL
  3. 您还可以定义相关的环境变量,例如ROOT_URL =“https://your_app.herokuapp.com”和MONGO_URL =“mongodb:// user:password@myserver.com:10139”
  4. 您也可以参考官方指南here

答案 1 :(得分:1)

所以你的意思是它可以在运行应用程序的同一设备上通过移动浏览器运行吗?

我最好的建议是你使用Remote Inspect(例如chrome:// inspect;主要是控制台和网络)来找出问题所在。

忘记/配置错误的标签或CSP?

答案 2 :(得分:0)

当我2年前使用Meteor时,我有类似的经历。我调试它的方式是使用Mathias R. Jessen。它不是调试错误的最佳方法,但它易于使用,所以在深入研究使用适当的调试工具(需要时间来设置和学习如何使用)之前,可能值得拍摄。