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
Comments
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? |
Here is a bit of what --verbose logs. I haven't installed any Cordova plugins other than the mdg:camera.
Certainly if there was an error in one of the plugins it would show an error of some sorts in the log no? |
In addition here is a list of installed packages.
|
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. |
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... |
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 |
@martijnwalraven is there a difference in the loading order between Cordova and Web Browser? |
I can't think of a reason why loading order would be different for Cordova. I assume these |
mmm that's interesting. @vacarsu can you please share a repo with a reproduction? |
@martijnwalraven if you don't need @Urigo That's right. My @vacarsu I have a few questions:
|
@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. |
@vacarsu could you try commenting out the The point of the exercise is to see if it's a timing (async loading) issue, as I mentioned above. |
@pbastowski No dice. Works in browser but not cordova still. I still see my templates loading before my lib folder. |
@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. |
@vacarsu Also, I would suggest trying to build your app with Meteor 1.1 to see if it works. |
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 For testing of errors like this, What I normally do is to add Then, I clone the |
Here's the repo, seems to not even be working in browser now. https://github.com/vacarsu/cordova-issue-reproduction. |
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. |
@vacarsu Buddy, you have an error in your code :) waitForUser() failed, which killed the state transition. So, that's why your 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. |
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.
I fixed this in my app by adding
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. |
Yeah, I do not get that resolve issue in my app, or the CORS issue. But, I am literally doing nothing different. |
@vacarsu when you asked
did you mean According to my debugs Now, I have to go sleep :) |
Yes you're right, now that makes sense. For me the error is Sorry the error is actually |
I put a material design sidenav on the index file which should hide on mobile screens. It showed up on |
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. |
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. |
I will see if I can reproduce this and push the updates to the repo. |
That was easy. https://github.com/vacarsu/cordova-issue-reproduction |
@vacarsu update to the latest version of angular2-now and try again. The problem was to do with 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. |
Ran with |
It also seems to not be letting me update angular2-now and angular.
|
try |
Okay packages updated, still same issue. |
Yes I have one I can test with. |
In case it help you, here is my packages list in the "Welcome..." app, above:
|
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. |
I restructured the repo to use ng-app and removed the root state and the broken resolve. |
Give me push access to your repo and I'll push a branch that works. |
Okay, did you remove the material design package - is that what the issue was? |
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.
|
That's odd I that I had updated it to 0.3.11. |
I have pushed the changes to branch |
Okay looks like it's working. Thanks for your help. |
Thanks for helping me fix a Cordova problem. |
@vacarsu @pbastowski very nice work |
great work! @vacarsu @pbastowski |
@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 |
@martijnwalraven That's a very good question. It appears that at the time that I had the same thoughts as you last night, about the root cause, but sleep was even more on my mind :) |
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 :) |
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.
The text was updated successfully, but these errors were encountered: