New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White screen with meteor run ios and meteor run android-device #5290

Closed
vacarsu opened this Issue Sep 25, 2015 · 55 comments

Comments

Projects
None yet
6 participants
@vacarsu

vacarsu commented Sep 25, 2015

Not sure why or if this has to do with the 1.2 update. But when I try to run meteor on ios emulator or android-device it builds successfully and runs the app, but all I get is a white screen. No errors in remote debugging. I've built one other app with meteor and have had white screen issues before, which I resolved simply by uninstalling the app and reinstalling it. None of the prior fixes seems to fix this issue though. Also when I try to do meteor run android, the android emulator opens, but it never finishes booting.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 25, 2015

Looking in chrome remote debugging, I see all of my files being loaded from meteor.local
Yet all I get is a blank white page.

screen shot 2015-09-25 at 4 49 37 pm

vacarsu commented Sep 25, 2015

Looking in chrome remote debugging, I see all of my files being loaded from meteor.local
Yet all I get is a blank white page.

screen shot 2015-09-25 at 4 49 37 pm

@martijnwalraven

This comment has been minimized.

Show comment
Hide comment
@martijnwalraven

martijnwalraven Sep 26, 2015

Contributor

The white page is usually an indication there is some kind of JavaScript error, it simply means the load could not be completed. The logs in the screen shot seem to confirm that.

The 'deviceready has not fired' message could be the result of a problem with plugin code. Maybe you're running older or incompatible plugin versions?

Contributor

martijnwalraven commented Sep 26, 2015

The white page is usually an indication there is some kind of JavaScript error, it simply means the load could not be completed. The logs in the screen shot seem to confirm that.

The 'deviceready has not fired' message could be the result of a problem with plugin code. Maybe you're running older or incompatible plugin versions?

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 26, 2015

Here is a bit of what --verbose logs. I haven't installed any Cordova plugins other than the mdg:camera.

:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources
:generateDebugSources
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 12.264 secs
Built the following apk(s):Device            -
    /Users/alex/Desktop/CloudFit/cloudfit/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /Users/alex/Desktop/CloudFit/cloudfit/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-debug.apk
Installing app on device...
Launching application...id Device            |
LAUNCH SUCCESSp on Android Device            -
Tailing logs for Android Device               
=> Started app on Android Device.  

Certainly if there was an error in one of the plugins it would show an error of some sorts in the log no?

vacarsu commented Sep 26, 2015

Here is a bit of what --verbose logs. I haven't installed any Cordova plugins other than the mdg:camera.

:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources
:generateDebugSources
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 12.264 secs
Built the following apk(s):Device            -
    /Users/alex/Desktop/CloudFit/cloudfit/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /Users/alex/Desktop/CloudFit/cloudfit/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-debug.apk
Installing app on device...
Launching application...id Device            |
LAUNCH SUCCESSp on Android Device            -
Tailing logs for Android Device               
=> Started app on Android Device.  

Certainly if there was an error in one of the plugins it would show an error of some sorts in the log no?

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 26, 2015

In addition here is a list of installed packages.

accounts-password                     1.1.3  Password support for accounts
aldeed:collection2                    2.5.0  Automatic validation of insert and update operations on the client and server.
angular                               1.0.0-rc.10* Everything you need to use AngularJS in your Meteor app
angular:angular-material              0.11.0  Google Material design written for AngularJs (official repo)
angularui:angular-ui-bootstrap        0.13.0  Native AngularJS (Angular) directives for Bootstrap.
angularui:angular-ui-router           0.2.15  angular-ui-router (official): Flexible routing with nested views in AngularJS
angularutils:pagination               0.7.0  Magical automatic pagination for anything in AngularJS
blaze-html-templates                  1.0.1  Compile HTML templates into reactive UI with Meteor Blaze
browser-policy                        1.0.5  Configure security policies enforced by the browser
cfs:access-point                      0.1.49  CollectionFS, add ddp and http accesspoint capability
cfs:filesystem                        0.1.2  Filesystem storage adapter for CollectionFS
cfs:gridfs                            0.0.33  GridFS storage adapter for CollectionFS
cfs:standard-packages                 0.5.9  Filesystem for Meteor, collectionFS
cfs:ui                                0.1.3  CollectionFS, provides UI helpers
check                                 1.0.6  Check whether a value matches a pattern
danialfarid:ng-file-upload            5.0.9  An AngularJS directive for file upload using HTML5 with FileAPI polyfill for unsupported browsers
ejson                                 1.0.7  Extended and Extensible JSON library
email                                 1.0.7  Send email messages
fortawesome:fontawesome               4.4.0  Font Awesome (official): 500+ scalable vector icons, customizable via CSS, Retina friendly
jquery                                1.11.4  Manipulate the DOM using CSS selectors
logging                               1.0.8  Logging facility.
mdg:camera                            1.2.0  Photos with one function call on desktop and mobile.
meteor-base                           1.0.1  Packages that every Meteor app needs
mobile-experience                     1.0.1  Packages for a great mobile user experience
mongo                                 1.1.1  Adaptor for using MongoDB and Minimongo over DDP
pbastowski:angular-babel              0.1.10  Write javascript ES6 in your Angular-Meteor app
pbastowski:angular2-now               0.3.8  Use Angular 2 @Component syntax with Angular 1 and Babel
planettraining:material-design-icons  2.0.0  Material design icons from google
random                                1.0.4  Random number generator and utilities
reload                                1.1.4  Reload the page while preserving application state.
session                               1.1.1  Session variable
spacebars                             1.0.7  Handlebars-like template language for Meteor
standard-minifiers                    1.0.0  Standard minifiers used with Meteor apps by default.
tracker                               1.0.8  Dependency tracker to allow reactive callbacks
twbs:bootstrap                        3.3.5  The most popular front-end framework for developing responsive, mobile first projects on the web.
urigo:angular-blaze-template          0.0.1  Include Blaze templates in your angular-meteor application.

vacarsu commented Sep 26, 2015

In addition here is a list of installed packages.

accounts-password                     1.1.3  Password support for accounts
aldeed:collection2                    2.5.0  Automatic validation of insert and update operations on the client and server.
angular                               1.0.0-rc.10* Everything you need to use AngularJS in your Meteor app
angular:angular-material              0.11.0  Google Material design written for AngularJs (official repo)
angularui:angular-ui-bootstrap        0.13.0  Native AngularJS (Angular) directives for Bootstrap.
angularui:angular-ui-router           0.2.15  angular-ui-router (official): Flexible routing with nested views in AngularJS
angularutils:pagination               0.7.0  Magical automatic pagination for anything in AngularJS
blaze-html-templates                  1.0.1  Compile HTML templates into reactive UI with Meteor Blaze
browser-policy                        1.0.5  Configure security policies enforced by the browser
cfs:access-point                      0.1.49  CollectionFS, add ddp and http accesspoint capability
cfs:filesystem                        0.1.2  Filesystem storage adapter for CollectionFS
cfs:gridfs                            0.0.33  GridFS storage adapter for CollectionFS
cfs:standard-packages                 0.5.9  Filesystem for Meteor, collectionFS
cfs:ui                                0.1.3  CollectionFS, provides UI helpers
check                                 1.0.6  Check whether a value matches a pattern
danialfarid:ng-file-upload            5.0.9  An AngularJS directive for file upload using HTML5 with FileAPI polyfill for unsupported browsers
ejson                                 1.0.7  Extended and Extensible JSON library
email                                 1.0.7  Send email messages
fortawesome:fontawesome               4.4.0  Font Awesome (official): 500+ scalable vector icons, customizable via CSS, Retina friendly
jquery                                1.11.4  Manipulate the DOM using CSS selectors
logging                               1.0.8  Logging facility.
mdg:camera                            1.2.0  Photos with one function call on desktop and mobile.
meteor-base                           1.0.1  Packages that every Meteor app needs
mobile-experience                     1.0.1  Packages for a great mobile user experience
mongo                                 1.1.1  Adaptor for using MongoDB and Minimongo over DDP
pbastowski:angular-babel              0.1.10  Write javascript ES6 in your Angular-Meteor app
pbastowski:angular2-now               0.3.8  Use Angular 2 @Component syntax with Angular 1 and Babel
planettraining:material-design-icons  2.0.0  Material design icons from google
random                                1.0.4  Random number generator and utilities
reload                                1.1.4  Reload the page while preserving application state.
session                               1.1.1  Session variable
spacebars                             1.0.7  Handlebars-like template language for Meteor
standard-minifiers                    1.0.0  Standard minifiers used with Meteor apps by default.
tracker                               1.0.8  Dependency tracker to allow reactive callbacks
twbs:bootstrap                        3.3.5  The most popular front-end framework for developing responsive, mobile first projects on the web.
urigo:angular-blaze-template          0.0.1  Include Blaze templates in your angular-meteor application.
@martijnwalraven

This comment has been minimized.

Show comment
Hide comment
@martijnwalraven

martijnwalraven Sep 26, 2015

Contributor

There is a lot in here that could be causing issues. In particular, all these different Angular packages catch my eye, but that might be because I'm not really familiar with them. Unfortunately, Cordova error reporting leaves a lot to be desired, making it hard to track these problems down. Does your app also run in a web browser? If not, all I can advise you is to try to find out what triggers the error by removing packages one by one.

Contributor

martijnwalraven commented Sep 26, 2015

There is a lot in here that could be causing issues. In particular, all these different Angular packages catch my eye, but that might be because I'm not really familiar with them. Unfortunately, Cordova error reporting leaves a lot to be desired, making it hard to track these problems down. Does your app also run in a web browser? If not, all I can advise you is to try to find out what triggers the error by removing packages one by one.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 26, 2015

Yes it runs in a web browser and everything works perfectly. This is why I am so confused. I've already gone through the process once before with little hitches.. I'm doing nothing different. Sure there are different packages, but really this should be working...

vacarsu commented Sep 26, 2015

Yes it runs in a web browser and everything works perfectly. This is why I am so confused. I've already gone through the process once before with little hitches.. I'm doing nothing different. Sure there are different packages, but really this should be working...

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

I think the issue is that my .ng.html.js files are loading before the es6.js files in my /lib folder. But this seems to be happening only in Cordova. possibly due to Urigo/angular-meteor#703

vacarsu commented Sep 27, 2015

I think the issue is that my .ng.html.js files are loading before the es6.js files in my /lib folder. But this seems to be happening only in Cordova. possibly due to Urigo/angular-meteor#703

@Urigo

This comment has been minimized.

Show comment
Hide comment
@Urigo

Urigo Sep 27, 2015

Contributor

@martijnwalraven is there a difference in the loading order between Cordova and Web Browser?
@vacarsu why do you think they are loaded before? do you actually see a difference in the inspector?

Contributor

Urigo commented Sep 27, 2015

@martijnwalraven is there a difference in the loading order between Cordova and Web Browser?
@vacarsu why do you think they are loaded before? do you actually see a difference in the inspector?

@martijnwalraven

This comment has been minimized.

Show comment
Hide comment
@martijnwalraven

martijnwalraven Sep 27, 2015

Contributor

I can't think of a reason why loading order would be different for Cordova.

I assume these *.es6.js files are processed by pbastowski:angular-babel? Is that still needed with Meteor 1.2?

Contributor

martijnwalraven commented Sep 27, 2015

I can't think of a reason why loading order would be different for Cordova.

I assume these *.es6.js files are processed by pbastowski:angular-babel? Is that still needed with Meteor 1.2?

@Urigo

This comment has been minimized.

Show comment
Hide comment
@Urigo

Urigo Sep 27, 2015

Contributor

mmm that's interesting.
I mean, I think it is still needed as pbastowski:angular-babel does more then just es6, it also adds ng-annotate and other features of es6.
But I don't see a reason in the code that is will change loading order. @pbastowski
We had a thing in an earlier version of angular but it was fixed with the help of @glasser and here there is nothing related to that problem.
and in anyway there is no reason it should be different in Cordova then in the browser as you say.

@vacarsu can you please share a repo with a reproduction?

Contributor

Urigo commented Sep 27, 2015

mmm that's interesting.
I mean, I think it is still needed as pbastowski:angular-babel does more then just es6, it also adds ng-annotate and other features of es6.
But I don't see a reason in the code that is will change loading order. @pbastowski
We had a thing in an earlier version of angular but it was fixed with the help of @glasser and here there is nothing related to that problem.
and in anyway there is no reason it should be different in Cordova then in the browser as you say.

@vacarsu can you please share a repo with a reproduction?

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

yes I can see my template files loading right after my packages but right before my /lib folder. Working on a reproduction now. For now here is a screenshot for proof. Right below all my template files it then loads my /lib folder.

screen shot 2015-09-27 at 4 20 58 am

Second screenshot showing right after loading of templates.

screen shot 2015-09-27 at 4 27 43 am

vacarsu commented Sep 27, 2015

yes I can see my template files loading right after my packages but right before my /lib folder. Working on a reproduction now. For now here is a screenshot for proof. Right below all my template files it then loads my /lib folder.

screen shot 2015-09-27 at 4 20 58 am

Second screenshot showing right after loading of templates.

screen shot 2015-09-27 at 4 27 43 am

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@martijnwalraven if you don't need ng-annotate, don't use angular2-now, don't need ES7 decorators or the import .... from syntax, as well as several other ES6 features, then the basic ecmascript package may work for you just fine. Otherwise you can continue using pbastowski:angular-babel. Having said this, I am not using Meteor 1.2 in production as yet, so, can't confirm whether or not all features work as with Meteor 1.1. This will reveal itself over the next few weeks.

@Urigo That's right. My pbastowski:angular-babel package does not, based on the environment or anything else that I know of, change the load order of files.
Do you know if the cordova wrapper introduces any kind of async loading?
I ask, because if the Angular app is bootstrapped before all of it's angular code is loaded then you could end up with a white screen. For example, if a default route @State does not execute before bootstrapping. I have experienced this before.
Also, there was recently a bug in Babel (Symbol.iterator related), which I patched in my package last week, that on the latest IOS versions produced a white screen. But then you actually got an error in the DEV console.

@vacarsu I have a few questions:

  1. Does your app work and has it ever worked with Meteor 1.1?
  2. How do you bootstrap the app in your code?

pbastowski commented Sep 27, 2015

@martijnwalraven if you don't need ng-annotate, don't use angular2-now, don't need ES7 decorators or the import .... from syntax, as well as several other ES6 features, then the basic ecmascript package may work for you just fine. Otherwise you can continue using pbastowski:angular-babel. Having said this, I am not using Meteor 1.2 in production as yet, so, can't confirm whether or not all features work as with Meteor 1.1. This will reveal itself over the next few weeks.

@Urigo That's right. My pbastowski:angular-babel package does not, based on the environment or anything else that I know of, change the load order of files.
Do you know if the cordova wrapper introduces any kind of async loading?
I ask, because if the Angular app is bootstrapped before all of it's angular code is loaded then you could end up with a white screen. For example, if a default route @State does not execute before bootstrapping. I have experienced this before.
Also, there was recently a bug in Babel (Symbol.iterator related), which I patched in my package last week, that on the latest IOS versions produced a white screen. But then you actually got an error in the DEV console.

@vacarsu I have a few questions:

  1. Does your app work and has it ever worked with Meteor 1.1?
  2. How do you bootstrap the app in your code?
@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

@pbastowski I never got to a point to test it in Meteor 1.1. I bootstrap my app in the /lib/app.es6.js file, I don't use the attribute directive. bootstrap(app)

vacarsu commented Sep 27, 2015

@pbastowski I never got to a point to test it in Meteor 1.1. I bootstrap my app in the /lib/app.es6.js file, I don't use the attribute directive. bootstrap(app)

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu could you try commenting out the bootstrap(app) line and adding an ng-app="app" to your "body" tag?

The point of the exercise is to see if it's a timing (async loading) issue, as I mentioned above.

pbastowski commented Sep 27, 2015

@vacarsu could you try commenting out the bootstrap(app) line and adding an ng-app="app" to your "body" tag?

The point of the exercise is to see if it's a timing (async loading) issue, as I mentioned above.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

@pbastowski No dice. Works in browser but not cordova still. I still see my templates loading before my lib folder.

vacarsu commented Sep 27, 2015

@pbastowski No dice. Works in browser but not cordova still. I still see my templates loading before my lib folder.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu OK, I need to see the code... Let me know when you have a reproduceable repo I can look at or the actual code you're working on.

pbastowski commented Sep 27, 2015

@vacarsu OK, I need to see the code... Let me know when you have a reproduceable repo I can look at or the actual code you're working on.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu Also, I would suggest trying to build your app with Meteor 1.1 to see if it works.

pbastowski commented Sep 27, 2015

@vacarsu Also, I would suggest trying to build your app with Meteor 1.1 to see if it works.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

Yes I did try building in 1.1 but I had to downgrade and after downgrading I started getting a standard-minifiers error. Will have a reproduction up shortly.

vacarsu commented Sep 27, 2015

Yes I did try building in 1.1 but I had to downgrade and after downgrading I started getting a standard-minifiers error. Will have a reproduction up shortly.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu For testing of errors like this, What I normally do is to add console.log('filename.ext') at the end of each .es6.js file that I have, so that I can see the actual order they execute in. Then I add another console.log('filename constructor') to the top of each constructor of each component/directive to see when they execute and if they execute at all.

Then, I clone the angular2-now package into my packages folder and add a console.log at line 426, see image below, so that I can see when the bootstrap actually occurs with respect to the files being loaded.

image

pbastowski commented Sep 27, 2015

@vacarsu For testing of errors like this, What I normally do is to add console.log('filename.ext') at the end of each .es6.js file that I have, so that I can see the actual order they execute in. Then I add another console.log('filename constructor') to the top of each constructor of each component/directive to see when they execute and if they execute at all.

Then, I clone the angular2-now package into my packages folder and add a console.log at line 426, see image below, so that I can see when the bootstrap actually occurs with respect to the files being loaded.

image

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

Here's the repo, seems to not even be working in browser now. https://github.com/vacarsu/cordova-issue-reproduction.

vacarsu commented Sep 27, 2015

Here's the repo, seems to not even be working in browser now. https://github.com/vacarsu/cordova-issue-reproduction.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

Thanks. I've had a brief look and haven't noticed anything unusual. Have to go out to do some shopping now, so, will have a look again after I come back.

pbastowski commented Sep 27, 2015

Thanks. I've had a brief look and haven't noticed anything unusual. Have to go out to do some shopping now, so, will have a look again after I come back.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu Buddy, you have an error in your code :)

waitForUser() failed, which killed the state transition. So, that's why your cordova-issue-reproduction repo doesn't work.

change your resolve to this:

  resolve: {
    'currentUser': ['$meteor', function($meteor){
      try {
        return $meteor.waitForUser();
      } catch (er) {
        console.log('Hey, buddy, waitForUser() failed!\n\n', er);
      }
    }]
  }

and it will work.

Check this in your Cordova wrapper and let me know if it works, please.

pbastowski commented Sep 27, 2015

@vacarsu Buddy, you have an error in your code :)

waitForUser() failed, which killed the state transition. So, that's why your cordova-issue-reproduction repo doesn't work.

change your resolve to this:

  resolve: {
    'currentUser': ['$meteor', function($meteor){
      try {
        return $meteor.waitForUser();
      } catch (er) {
        console.log('Hey, buddy, waitForUser() failed!\n\n', er);
      }
    }]
  }

and it will work.

Check this in your Cordova wrapper and let me know if it works, please.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu Perhaps there is a Cordova related error in your @State resolver block that makes the state transition fail? Any error thrown and not trapped in a State resolve block will cancel the transition.

pbastowski commented Sep 27, 2015

@vacarsu Perhaps there is a Cordova related error in your @State resolver block that makes the state transition fail? Any error thrown and not trapped in a State resolve block will cancel the transition.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

Sorry about that I updated it in the repo, I had been at it for a while when I made that. So now it works in browser but not in Cordova.

in the reproduction I am getting the following.

XMLHttpRequest cannot load http://10.0.2.2:3000/sockjs/info?cb=yp9o7b9ta3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://meteor.local' is therefore not allowed access. The response had HTTP status code 404.

I fixed this in my app by adding

Meteor.startup(function() {
  BrowserPolicy.content.allowSameOriginForAll('http://meteor.local');
});

However, this does not seem to fix the CORS error for the reproduction. Kind of strange...

and btw why is $meteor not a function here in the resolve. I have never had issues like that before.

vacarsu commented Sep 27, 2015

Sorry about that I updated it in the repo, I had been at it for a while when I made that. So now it works in browser but not in Cordova.

in the reproduction I am getting the following.

XMLHttpRequest cannot load http://10.0.2.2:3000/sockjs/info?cb=yp9o7b9ta3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://meteor.local' is therefore not allowed access. The response had HTTP status code 404.

I fixed this in my app by adding

Meteor.startup(function() {
  BrowserPolicy.content.allowSameOriginForAll('http://meteor.local');
});

However, this does not seem to fix the CORS error for the reproduction. Kind of strange...

and btw why is $meteor not a function here in the resolve. I have never had issues like that before.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

Yeah, I do not get that resolve issue in my app, or the CORS issue. But, I am literally doing nothing different.

vacarsu commented Sep 27, 2015

Yeah, I do not get that resolve issue in my app, or the CORS issue. But, I am literally doing nothing different.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 27, 2015

@vacarsu when you asked

why is $meteor not a function here in the resolve. I have never had issues like that before.

did you mean $meteor.waitForUser?

According to my debugs $meteor is defined, but waitForUser is not. That is probably because the code is not being executed in the correct order, since $meteor.waitForUser is actually syntactic sugar for $meteorUser.waitForUser. $meteor is defined in angular-meteor.js and $meteorUser in angular-meteor-user.js.

Now, I have to go sleep :)

pbastowski commented Sep 27, 2015

@vacarsu when you asked

why is $meteor not a function here in the resolve. I have never had issues like that before.

did you mean $meteor.waitForUser?

According to my debugs $meteor is defined, but waitForUser is not. That is probably because the code is not being executed in the correct order, since $meteor.waitForUser is actually syntactic sugar for $meteorUser.waitForUser. $meteor is defined in angular-meteor.js and $meteorUser in angular-meteor-user.js.

Now, I have to go sleep :)

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 27, 2015

Yes you're right, now that makes sense. For me the error is $meteor is not a function.

Sorry the error is actually TypeError: $meteor.waitForUser is not a function(…)

vacarsu commented Sep 27, 2015

Yes you're right, now that makes sense. For me the error is $meteor is not a function.

Sorry the error is actually TypeError: $meteor.waitForUser is not a function(…)

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

I put a material design sidenav on the index file which should hide on mobile screens. It showed up on android-device. So this would mean that my templates are indeed loading before my /lib/app.es6.js file correct? I should also add that the sidenav does not appear styled.

vacarsu commented Sep 28, 2015

I put a material design sidenav on the index file which should hide on mobile screens. It showed up on android-device. So this would mean that my templates are indeed loading before my /lib/app.es6.js file correct? I should also add that the sidenav does not appear styled.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

So, you got the app running finally on Android, is that right? What was the cause of the white screen? We'd like to know for the record.

Re your question, all I can say is it is possible that the load order could different under Cordova, which under certain circumstances could cause problems. However, I don't have an Android setup or your actual code and thus can't verify this assumption.

pbastowski commented Sep 28, 2015

So, you got the app running finally on Android, is that right? What was the cause of the white screen? We'd like to know for the record.

Re your question, all I can say is it is possible that the load order could different under Cordova, which under certain circumstances could cause problems. However, I don't have an Android setup or your actual code and thus can't verify this assumption.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Well it's still not quite running right. the ui-views aren't loading I put a sidenav on the index that should hide on mobile and it appears completely unstyled. things just aren't loading right in Cordova.

vacarsu commented Sep 28, 2015

Well it's still not quite running right. the ui-views aren't loading I put a sidenav on the index that should hide on mobile and it appears completely unstyled. things just aren't loading right in Cordova.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

I will see if I can reproduce this and push the updates to the repo.

vacarsu commented Sep 28, 2015

I will see if I can reproduce this and push the updates to the repo.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

That was easy. https://github.com/vacarsu/cordova-issue-reproduction
I added the ios platform you can simply do meteor run ios and see what I'm talking about.

vacarsu commented Sep 28, 2015

That was easy. https://github.com/vacarsu/cordova-issue-reproduction
I added the ios platform you can simply do meteor run ios and see what I'm talking about.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

@vacarsu update to the latest version of angular2-now and try again.

The problem was to do with Meteor.isCordova. It (.isCordova) does not exist, even when running under cordova, as in "meteor run ios". So, the app was never bootstrapped under cordova.

Don't bother with the reproduction repo, just update to angular2-now@0.3.11 and tell me if something has changed.

My test app now runs just fine on IOS with no other changes.

pbastowski commented Sep 28, 2015

@vacarsu update to the latest version of angular2-now and try again.

The problem was to do with Meteor.isCordova. It (.isCordova) does not exist, even when running under cordova, as in "meteor run ios". So, the app was never bootstrapped under cordova.

Don't bother with the reproduction repo, just update to angular2-now@0.3.11 and tell me if something has changed.

My test app now runs just fine on IOS with no other changes.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

 Errors prevented startup:                  

   While selecting package versions:
   error: Potentially incompatible change required to top-level dependency: pbastowski:angular2-now 0.3.8, was 0.3.11.
   Constraints on package "pbastowski:angular2-now":

   To allow potentially incompatible changes to top-level dependencies, you must pass --allow-incompatible-update on the command line.

Ran with --allow-incompatible-update but it had no effect.

vacarsu commented Sep 28, 2015

 Errors prevented startup:                  

   While selecting package versions:
   error: Potentially incompatible change required to top-level dependency: pbastowski:angular2-now 0.3.8, was 0.3.11.
   Constraints on package "pbastowski:angular2-now":

   To allow potentially incompatible changes to top-level dependencies, you must pass --allow-incompatible-update on the command line.

Ran with --allow-incompatible-update but it had no effect.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

It also seems to not be letting me update angular2-now and angular.

This project is already at Meteor 1.2.0.1, the latest release.
Your top-level dependencies are at their latest compatible versions.

The following top-level dependencies were not updated to the very latest version available:
 * angular 1.0.0-rc.10 (1.0.0-rc.11 is available)
 * pbastowski:angular2-now 0.3.8 (0.3.11 is available)

vacarsu commented Sep 28, 2015

It also seems to not be letting me update angular2-now and angular.

This project is already at Meteor 1.2.0.1, the latest release.
Your top-level dependencies are at their latest compatible versions.

The following top-level dependencies were not updated to the very latest version available:
 * angular 1.0.0-rc.10 (1.0.0-rc.11 is available)
 * pbastowski:angular2-now 0.3.8 (0.3.11 is available)
@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

try meteor add pbastowski:angular2-now@0.3.11

pbastowski commented Sep 28, 2015

try meteor add pbastowski:angular2-now@0.3.11

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Okay packages updated, still same issue.

vacarsu commented Sep 28, 2015

Okay packages updated, still same issue.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

I have two working apps under Meteor 1.2 on IOS, both using angular2-now and ui-router, see images below.

There must be something wrong with your code, me thinks.

Do you have any Meteor app that uses anguar2-now which you could test with?

image

image

pbastowski commented Sep 28, 2015

I have two working apps under Meteor 1.2 on IOS, both using angular2-now and ui-router, see images below.

There must be something wrong with your code, me thinks.

Do you have any Meteor app that uses anguar2-now which you could test with?

image

image

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Yes I have one I can test with.

vacarsu commented Sep 28, 2015

Yes I have one I can test with.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

In case it help you, here is my packages list in the "Welcome..." app, above:

angular                      1.0.0-rc.11  Everything you need to use AngularJS in your Meteor app
angularui:angular-ui-router  0.2.15  angular-ui-router (official): Flexible routing with nested views i...
autopublish                  1.0.4  (For prototyping only) Publish the entire database to all clients
blaze-html-templates         1.0.1  Compile HTML templates into reactive UI with Meteor Blaze
civilframe:angular-jade      0.0.3  Jade templating for Meteor-Angular
ecmascript                   0.1.4  Compiler plugin that supports ES2015+ in all .js files
es5-shim                     4.1.13  Shims and polyfills to improve ECMAScript 5 support
insecure                     1.0.4  (For prototyping only) Allow all database writes from the client
jquery                       1.11.4  Manipulate the DOM using CSS selectors
meteor-base                  1.0.1  Packages that every Meteor app needs
mobile-experience            1.0.1  Packages for a great mobile user experience
mongo                        1.1.1  Adaptor for using MongoDB and Minimongo over DDP
mquandalle:jade              0.4.3_1  Jade template language
pbastowski:angular2-now      0.3.11  Use Angular 2 @Component syntax with Angular 1 and Babel
pbastowski:require           0.0.3  Simple require stub
session                      1.1.1  Session variable
standard-minifiers           1.0.0  Standard minifiers used with Meteor apps by default.
tracker                      1.0.8  Dependency tracker to allow reactive callbacks
twbs:bootstrap               3.3.5  The most popular front-end framework for developing responsive, mob...

pbastowski commented Sep 28, 2015

In case it help you, here is my packages list in the "Welcome..." app, above:

angular                      1.0.0-rc.11  Everything you need to use AngularJS in your Meteor app
angularui:angular-ui-router  0.2.15  angular-ui-router (official): Flexible routing with nested views i...
autopublish                  1.0.4  (For prototyping only) Publish the entire database to all clients
blaze-html-templates         1.0.1  Compile HTML templates into reactive UI with Meteor Blaze
civilframe:angular-jade      0.0.3  Jade templating for Meteor-Angular
ecmascript                   0.1.4  Compiler plugin that supports ES2015+ in all .js files
es5-shim                     4.1.13  Shims and polyfills to improve ECMAScript 5 support
insecure                     1.0.4  (For prototyping only) Allow all database writes from the client
jquery                       1.11.4  Manipulate the DOM using CSS selectors
meteor-base                  1.0.1  Packages that every Meteor app needs
mobile-experience            1.0.1  Packages for a great mobile user experience
mongo                        1.1.1  Adaptor for using MongoDB and Minimongo over DDP
mquandalle:jade              0.4.3_1  Jade template language
pbastowski:angular2-now      0.3.11  Use Angular 2 @Component syntax with Angular 1 and Babel
pbastowski:require           0.0.3  Simple require stub
session                      1.1.1  Session variable
standard-minifiers           1.0.0  Standard minifiers used with Meteor apps by default.
tracker                      1.0.8  Dependency tracker to allow reactive callbacks
twbs:bootstrap               3.3.5  The most popular front-end framework for developing responsive, mob...
@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Hmm I really feel like the app in the repo I posted above should be working. I only have 4 packages installed. If I can get that one working I am certain I can get the others working... I have no clue how I am supposed to figure out what is going on here, when I have no errors in Cordova or in browser, and yet it's broken in Cordova, but works fine in browser.

vacarsu commented Sep 28, 2015

Hmm I really feel like the app in the repo I posted above should be working. I only have 4 packages installed. If I can get that one working I am certain I can get the others working... I have no clue how I am supposed to figure out what is going on here, when I have no errors in Cordova or in browser, and yet it's broken in Cordova, but works fine in browser.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

I restructured the repo to use ng-app and removed the root state and the broken resolve.

vacarsu commented Sep 28, 2015

I restructured the repo to use ng-app and removed the root state and the broken resolve.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

OK, here is an image of your app running in browser and on the IOS emulator:

image

pbastowski commented Sep 28, 2015

OK, here is an image of your app running in browser and on the IOS emulator:

image

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

Give me push access to your repo and I'll push a branch that works.

pbastowski commented Sep 28, 2015

Give me push access to your repo and I'll push a branch that works.

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Okay, did you remove the material design package - is that what the issue was?

vacarsu commented Sep 28, 2015

Okay, did you remove the material design package - is that what the issue was?

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

No. I updated to angular2-now@0.3.11 and then just removed the material code from body to make things simpler to work with.
Here is the commit log:

  • Updated to angular2-now@0.3.11
  • Removed ng-app from body
  • put back bootstrap in app.es6.js
  • added some console.logs to show in which order the different js files execute.
  • Removed the angular-material stuf from body to make things easier to see.

pbastowski commented Sep 28, 2015

No. I updated to angular2-now@0.3.11 and then just removed the material code from body to make things simpler to work with.
Here is the commit log:

  • Updated to angular2-now@0.3.11
  • Removed ng-app from body
  • put back bootstrap in app.es6.js
  • added some console.logs to show in which order the different js files execute.
  • Removed the angular-material stuf from body to make things easier to see.
@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

That's odd I that I had updated it to 0.3.11.

vacarsu commented Sep 28, 2015

That's odd I that I had updated it to 0.3.11.

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

I have pushed the changes to branch feature/working-ios

pbastowski commented Sep 28, 2015

I have pushed the changes to branch feature/working-ios

@vacarsu

This comment has been minimized.

Show comment
Hide comment
@vacarsu

vacarsu Sep 28, 2015

Okay looks like it's working. Thanks for your help.

vacarsu commented Sep 28, 2015

Okay looks like it's working. Thanks for your help.

@vacarsu vacarsu closed this Sep 28, 2015

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 28, 2015

Thanks for helping me fix a Cordova problem.

pbastowski commented Sep 28, 2015

Thanks for helping me fix a Cordova problem.

@Urigo

This comment has been minimized.

Show comment
Hide comment
@Urigo

Urigo Sep 28, 2015

Contributor

@vacarsu @pbastowski very nice work

Contributor

Urigo commented Sep 28, 2015

@vacarsu @pbastowski very nice work

@AccessIPD

This comment has been minimized.

Show comment
Hide comment
@AccessIPD

AccessIPD commented Sep 29, 2015

great work! @vacarsu @pbastowski

@martijnwalraven

This comment has been minimized.

Show comment
Hide comment
@martijnwalraven

martijnwalraven Sep 29, 2015

Contributor

@pbastowski Thanks a lot for looking into this and getting it to work! But I don't really understand why the fix is necessary. What is the reason Meteor.isCordova is not defined?

Contributor

martijnwalraven commented Sep 29, 2015

@pbastowski Thanks a lot for looking into this and getting it to work! But I don't really understand why the fix is necessary. What is the reason Meteor.isCordova is not defined?

@pbastowski

This comment has been minimized.

Show comment
Hide comment
@pbastowski

pbastowski Sep 29, 2015

@martijnwalraven That's a very good question. It appears that at the time that angular2-now.js code is running, the part of Meteor/Cordova that makes Meteor.isCordova available hasn't run yet. At the same time, however, the Cordova object itself is globally visible already.

I had the same thoughts as you last night, about the root cause, but sleep was even more on my mind :) isCordova is definitely available for testing after the app has loaded fully. I know that much, because I checked it in Safari's remote debug console. Further investigation is required to find the root cause, but for the moment it works.

pbastowski commented Sep 29, 2015

@martijnwalraven That's a very good question. It appears that at the time that angular2-now.js code is running, the part of Meteor/Cordova that makes Meteor.isCordova available hasn't run yet. At the same time, however, the Cordova object itself is globally visible already.

I had the same thoughts as you last night, about the root cause, but sleep was even more on my mind :) isCordova is definitely available for testing after the app has loaded fully. I know that much, because I checked it in Safari's remote debug console. Further investigation is required to find the root cause, but for the moment it works.

@NawazKhanMd

This comment has been minimized.

Show comment
Hide comment
@NawazKhanMd

NawazKhanMd Feb 15, 2017

do we need a virtual host to run my meteor app on mobile?

cuz am running meteor run android-device -p MyIp:3000 --mobile-server virtualHostIpToWhichMobileIsConnected:3000

this gives me a blank screen

am i doing it wrong pls Reply :)

NawazKhanMd commented Feb 15, 2017

do we need a virtual host to run my meteor app on mobile?

cuz am running meteor run android-device -p MyIp:3000 --mobile-server virtualHostIpToWhichMobileIsConnected:3000

this gives me a blank screen

am i doing it wrong pls Reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment