Software Archive
Read-only legacy content
17061 Discussions

Android and iOS apps only working after device restart, Windows crashes on start up

Nick_d_
Beginner
898 Views

Hi, I need urgent help please. My deadline for release is next week.

I have built an app and managed to compile/build it for all available platforms on Intel XDK. I am using the version that was released on 22 August 2016 (actually the one before that but upgraded when it came out) and my Cordova/CL version is 5.4.1

I have installed the app on my LG G$ with no problems and no restarts required, but on my Apple iPad and Samsung Note 10.1 testing devices, the app installs but just shows a white screen after the splash screen and then only works once I restart the device.

I have an entirely different problem on Windows 10, 8 and 8.1 - the app crashes and closes directly after the splashscreen.

I have no idea what's causing these errors but I read somewhere that $jquery.mobile.back() causes Windows problems. I don't use that method though, but I do manipulate the history stack at some point, but that is well after the app has started. I also heard that it could be about cross-origin requests, but not sure as iOS and Android allow it, only just after device restart... So confused!

Please assist urgently. I need help with:
- iOS and Android apps only working after device restart
- Windows app crashes and closes after splashscreen display.

All these app versions are test versions, so test/development certificates are used. In case that helps.

Regards,
Nick

0 Kudos
19 Replies
PaulF_IntelCorp
Employee
898 Views

Nick -- regarding the Windows crashing, please see this post > https://software.intel.com/en-us/forums/intel-xdk/topic/607055 <

Regarding the restart required on iOS and Android -- given the behavior, I suspect it has something to do with your app logic. Are you loading a page in your app, such as in an iframe? Are you loading JS or fonts or images or other resources remotely using a simple URL? Any attempts to retrieve network-based resources, especially immediately upon start, can result in a hang, especially if you have a slow or bad network connection, or if the device was asleep, etc.

0 Kudos
Nick_d_
Beginner
898 Views

Hi Paul,

Thanks for your response. Unfortunately I still experience the same issues.

Windows 8.1: I managed to get the app to install based on the info in that article you linked, so thanks for that!! Problem however, the app ran the first time, with quite a bit of issues, and since then it displays the first page then crashes. I use localStorage to determine if a username is stored, which will redirect the user to the 'home' page of the app using jquerymobile's $.monile.changePage(). Could that be causing a crash? Or could localStorage itself be a problem? 

Windows 10 UAP: Same problem, still crashes during start up.

Android and iOS: I changed some of the logic, for all platforms, as you elluded to that being a potential problem. Issues remain. Even my LG G4 now has that issue - requiring the device to be restarted, or the app to be force-stopped, to be able to restart it and work.

Can I please send you my source code for investigation? I really need help here.

Cheers

Nick

0 Kudos
PaulF_IntelCorp
Employee
898 Views

Nick -- redirecting your webview to display a remote page within the webview is not recommended practice. If you want to do that you should use the inAppBrowser plugin (using the API, not window.open) to then display your site pages in the mobile browser on the device. The Cordova webview environment is not a browser, it is a webview that feels like a browser environment, but is not. See this blog for a little background > http://blogs.intel.com/evangelists/2014/09/02/html5-web-app-webview-app/ < regarding what a webview is. Additionally, pages you display in the webview do NOT have access to Cordova APIs.

I recommend you use the Debug tab or the technique outlined here > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools < to get a closer look at what you are doing. Sorry, but we don't have the resources to debug app-specific issues, only build and project configuration problems. You are creating a Cordova app, so searching for programming solutions on StackOverflow regarding Cordova and PhoneGap apps will apply here, as well.

0 Kudos
Nick_d_
Beginner
898 Views

Hi Paul, there seems to be a misunderstanding. Perhaps I'm not clear. The change of page is a jquerymobile page, it's all in my index.html file, which makes this a weird problem, as it never occurred with prior versions of XDK, right up until the last version before you brought in the new emulator. All builds used to work, now for some reason I have blank white screens on the first time the app runs after install. I would bet money that something in XDK's build systems have changed. Even when emulating in the new simulator tab, the app has blank white screens until I change the device, then it shows the app. So this must be on XDK's side, as it always worked first time in previous versions of XDK adn the builds I did.

Whatever the reason is, do you think it would be the same reason as to why the Windows 10 version keeps crashing?

Regarding your advice to use the debug tab: I use it all the time, it isn't kicking up any issues, which makes it more frustrating. My app logic is fine as it always worked up until I upgraded XDK. Do you think a downgrade in my Cordova/CL or a rollback to a previous version of XDK could help?

I use Stack Overflow religiously, but am not finding help - hence my address to you :)

0 Kudos
PaulF_IntelCorp
Employee
898 Views

Nick -- thanks for the clarification.

The compat JS file is needed to make jQuery Mobile work on Windows 8.x devices. We've been seeing some crash issues if you build specifically for Windows 10, which we have not been able to resolve, however, Windows 8.x builds should run on a Windows 10 system (assuming, of course, that they also run on a Windows 8.x system). You can build for Windows 8.x if you choose 5.4.1 or 5.1.1.

Are you using jQuery 2.x, that does work better with the more recent versions of Cordova, many people have had troubles with jQuery 1.x and updating to 2.x resolves many of those issues (do not upgrade to jQuery 3.x, it doesn't work with jQuery Mobile). If you're using App Designer you can change out the jQuery in the project and App Designer will leave it alone, it will not undo your changes to the jQuery library file.

If you build with 5.1.1 do you still get your blank screen? Or 5.4.1? Which CLI version are you using? There have been changes to the backend, but mostly to add 6.2.0, the other two build systems are largely unchanged, changes there have mostly to do with catching error conditions and providing additional feedback.

Which version of Crosswalk are you using? Dial back to 17 if you are using 19 to see if that makes a difference.

Regarding the Simulate tab and blank screens there, are you seeing anything useful in the CDT console (the bug icon) which might explain what is going on?

0 Kudos
Nick_d_
Beginner
898 Views

Hi Paul,

Thanks, this is some serious quality feedback. I'm going to try it now and let you know what happens. 

To answer your questions:

  • I'm using jquerymobile 1.4.5, having been too scared to upgrade not knowing if it will bomb-out or not
  • Jquery is 1.10.2
  • CL: 5.4.1 currently - same issue on 5.1.1 in th Simulate tab
  • Crosswalk: Not sure where to check that, not seeing a version number anywhere, but it's the one that came with this version of XDK

I just tried running th Windows 8.1 on my Windows 10 pc, same thing, crashes after startup.

I'll also upgrade my jquery and jquerymobile to what you suggested and then let you know if that helps.... or not. :)

0 Kudos
PaulF_IntelCorp
Employee
898 Views

Nick -- Crosswalk settings are only relevant on the Android builds, they do not apply for iOS or Windows. See screenshots below, from Android Build Settings on the Projects tab for reference to changing Crosswalk build options.

You should be able to upgrade the jQuery without changing your copy of jQuery Mobile.

Are you seeing any error messages or otherwise in the CDT debug console?

Get it all working on Android first, it provides the best debug environment, the rest will be easier after that.

Screen Shot 2016-08-25 at 2.26.31 PM.png

Screen Shot 2016-08-25 at 2.26.21 PM.png

0 Kudos
Nick_d_
Beginner
898 Views

Hey Paul,

Blank screens:
Ok, so I got it working, don't I feel like an idiot now. You were right initially, there was an error in my logic, which I never picked up because it worked on previous versions of XDK and the error was never thrown out before. The error was in the debugger as you mentioned, it was just lost in a lot of logs to the console. I remembered seeing the error just after I upgraded XDK the last time, but as mentioned, the app starts when you select a new device in the simulator, so I ended up forgetting about the error. Anyway, after changing the order in which I call scripts and functions, it works in the simulator. I'm about to do a build for all platforms and test.

I am so sorry to have wasted your time on this!

Windows crashing:
I'm about to do a build now to install an 8.1 app on Windows 10 - I'm hoping the above is the reason for the errors experience on Windows 8.x. Will advise once all builds are complete and installed.

Please do me a favour. Please reply to this (if you remember to) once you guys have a resolution for the Windows10 crash issues - it may help :)

Again, sincerest apologies for wasting your time! XDK rocks and it was definitely an error on my end from what I can see for now :)

0 Kudos
PaulF_IntelCorp
Employee
898 Views

We'll definitely post when we resolve the Windows 10 thing, probably in a sticky on the forum or in a tweet. Glad you figured out the issue. Remember to add this > https://github.com/xmnboy/xdk-win8x-compat.js < for the Win8 builds, especially since you are using jQuery and jQuery Mobile. It does nothing on Android and iOS, so it's safe to include in your app for all builds.

0 Kudos
Nick_d_
Beginner
898 Views

Thanks!

I have included that script for the Windows builds into my project - but I'm getting the same.

Can you please clear up the confusion I have around the Windows Build targets?

XDK build tile Windows 8 - builds??
XDK build tile Windows Phone 8.1 - builds??

Can I run them both on a Windows 8.1 PC for instance? I don't have  Windows phone with me so am using tablets and my PC.

0 Kudos
Nick_d_
Beginner
898 Views

Hi Paul,

When doing WP8.1 builds and trying to install them on my Windows10 PC, I get the following message on the install window:

Ask the app developer for a new app package. This one isn’t signed with a trusted certificate (0x800B0100).

What do I do to correct this?

 

0 Kudos
PaulF_IntelCorp
Employee
898 Views

Nick -- you cannot install a Windows Phone 8.x build onto a Windows system (that is, something that's running the Windows OS that you see on desktops, laptops, tablets, etc.). The two are quite different. Windows 10 Universal tries to rectify that, but that is not what Windows Phone 8.x and Windows 8.x create.

Windows 8 builds a Windows 8.0 app that can be installed onto a Windows 8, 8.1 or 10 desktop, laptop, tablet, etc. Anything that is running "Microsoft Windows" -- it cannot be installed on a Windows Phone, of any version.

If you do not have a Windows Phone, and are not intending to deploy to a Windows Phone, then you an restrict yourself to building Windows 8 images.
 

0 Kudos
Nick_d_
Beginner
899 Views

Hey Paul,

Thanks so much for that clarity! I had the incorrect understanding that Win 8, 8.1 were mobile too, as in it was the same version as WP* - aka like what you said about Win10...

Anyway, got Windows 10 version running, weirdly enough, but the moment I click a radio button, it crashes. I upgraded my Jquery to 2.1.4 and it at least installed and ran. But radio button clicking is a problem - do you know if any of those crashes you mentioned were radio-button related?

0 Kudos
PaulF_IntelCorp
Employee
899 Views

The Windows 10 crashes we are investigating are specific to building a Windows 10 Universal app, they do not apply to building a Windows 8 app. When you run a Windows 8 app on a Windows 10 system it runs in the Windows 8 webview, not in the Windows 10 webview; Microsoft is very good about maintaining backward compatibility.

If you are building a Windows 8 app the crash you are experiencing is likely something in your app or something about the IE 10/11 webview (Silverlight) that is different enough from the Chrome webview in Android or the Safari webview in iOS to raise "heck" with your app. If you are building for Windows 10 and running on Windows 10, then you are likely running into the unresolved issue we are chasing.

One way to try and debug a Windows 8 build is to open the app within IE 10 and use that debugger (avoiding any Cordova API calls, of course); IE 10 is not a perfect simulation of the Window 8 webview, but it's as close as you can get. Unfortunately, debugging Windows Cordova apps is very difficult. You might need to use weinre to figure it out (I recommend the approach described here > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#WEINRE <). Also, make sure you're using the compat library I pointed you to, if you are using alerts in your app they will not work without that library on a Windows 8 build.

0 Kudos
Nick_d_
Beginner
899 Views

Thanks, will try.

 

The problem I have with debugging in a browser is that it often doesn't a,low me to log in or make calls to my server as it doesn't allow cross-origin requests, and I have no idea how to circumvent that. Will try and let you know what I find :) It's baffling my mind, as both Windows 8 and Windows 10 builds provide the same issue now... I will try the WP* build on my dad's phone over the weekend and see what happens there.

Should it turn out it's a webview problem - what can be done about that?

0 Kudos
PaulF_IntelCorp
Employee
899 Views

Different webviews are like different browsers: you have to adapt your code to handle the differences and idiosyncrasies of each platform. If you are trying to understand what is causing the crash, it may have nothing to do with logging into your server, it may be simpler than that. So trying inside the browser is at least worth trying to see if there's some odd little HTML5 thing that is the source of your pain. Using weinre is also very helpful in this situation (again, I recommend the procedure I sent a link to, not the weinre server in the Test tab, a local weinre connection works much better).

0 Kudos
Nick_d_
Beginner
899 Views

I'm not able to run my app in a browser because it requires a user to sign in, and browsers don't allow cross-origiin calls, so I'm in a bit of a tough spot, unless you know something I don't?

What procedure are you talking about?

Also, I've managed to create the package for WP8 but how do I sign it? XDK does noes allow for upload of certificates or the Windows version of a plist file (can't remember its name) - how would I get the app ready for install from XDK?

0 Kudos
PaulF_IntelCorp
Employee
899 Views

Nick d. wrote:

I'm not able to run my app in a browser because it requires a user to sign in, and browsers don't allow cross-origiin calls, so I'm in a bit of a tough spot, unless you know something I don't?

What procedure are you talking about?

Also, I've managed to create the package for WP8 but how do I sign it? XDK does noes allow for upload of certificates or the Windows version of a plist file (can't remember its name) - how would I get the app ready for install from XDK?

Nick -- you may have to "pretend" to login or fake a login or simply host the source on your server so you avoid the cross-origin issue, in order to use the browser debugging solution. In other words, you may have to rewrite your app here and there to accommodate a different debug environment, in order to figure out where and what the problem is (assuming it's not directly related to logging in).

There is no file you submit for signing your Windows app, there are some fields in the build settings section of the projects tab you have to fill out, with information from your Windows dev account.

0 Kudos
Nick_d_
Beginner
899 Views

Cool, will do thanks!

I checked the debugger and saw an error when clicking on the radio buttons - problem is it works on Android and iOS in the simulator and build files. Windows is the only difficult one. Here's the error:

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh' 

I have researched it but nothing comes up specific to my situation. From what I gather, that error is for when you create those radio buttons dynamically and you already have code addressing them before they are created.... But mine are there from the beginning, so that error doesn't make sense to me. Never had the error before I upgraded to jquery 2.4.1, unless I missed it... Not sure... Will keep plugging away.

0 Kudos
Reply