Software Archive
Read-only legacy content
17061 Discussions

Windows Phone 8.1 app closes after opening

Mateus_A_
Beginner
5,574 Views
 
Hello , I managed after a long time , run my application on the device with windows phone 8.1 , but when trying to open the same, the SplashScreen loads normally (using the Default Splash XDK put in landscape mode) , after or my application starts Index for a second or two, and he closes it after loading . I tried to change the version of the CLI , use another project without any method , etc., but there was the same application problem close of nowhere. The method I used was to install this . This configuration may be some problem, or the like, or what ?
 
Im testing on a Lumia 1020, running a Lumia Denim( Windows Phone 8.1 Update) .
 
 
 
 
0 Kudos
46 Replies
PaulF_IntelCorp
Employee
2,117 Views

My guess would be the google maps JS file is not getting loaded or something about it fails in that environment. You might have to do some experiments within IE11 to uncover what is going on or search for using google maps in IE.

0 Kudos
André_V_
Beginner
2,117 Views

Thanks Paul. I changed document.addEventListener("deviceready", initialize, false); to document.addEventListener("DOMContentLoaded", initialize, false); and now the maps is working in IE11 and Edge, but if I install in windows phone the maps doesn't appers. 

0 Kudos
Valerio_P_1
Beginner
2,117 Views

Hello, I have the same problem, use Intel XDK 3240, cordova cli 5.4.1, I include at the top of the head the xdk-win8x-compat.js script and try to view a google maps on my app.

Into the head of html I have included the following script with a valid key


<script async defer src="https://maps.googleapis.com/maps/api/js?key=myKey&callback=mapReady"></script>
 
Adding callback parameter, after google maps api is ready, call my function mapReady() that does a simple alert.

I tested it with IE11 and everything works perfectly, but with build for Windows Phone 8.1, just the app refers to the google maps, crashes and also the alerts that you should see if charged the google maps api is never displayed.

I tried both http and https and the result does not change.

I must give up forever?

0 Kudos
André_V_
Beginner
2,117 Views

Don't give up rsrsrs.
I already did test with callback.

I just need google maps working to publish the app.

Somebody from intel can help us? Maybe testing the google maps sample of xdk.

0 Kudos
Pamela_H_Intel
Moderator
2,117 Views

I will take a look and see if I can find a resolution. But don't give up. Though Windows mobile is difficult sometimes, it continues to be easier to work with - the mobile dev tools and Windows itself have been changing to make mobile development easier.

0 Kudos
André_V_
Beginner
2,117 Views

I resolved to change google maps to bing maps, but i received the same error " 'Microsoft' is undefined". I think that we need some permission to use some map in windows phone. I tried a lot of thing but until now nothing resolve.

0 Kudos
André_V_
Beginner
2,117 Views

The error isn't with google maps API. I did a file in server only with a alert("ok") and call in a script tag, but when I start the app the alert are not show, in browser, emulator or android device the alert are showing. There is some reason to windows phone can't open external files? If i copy the google maps api to a js file and use in my app the maps appears.

0 Kudos
PaulF_IntelCorp
Employee
2,117 Views

You might need to add some X-CSP... directives to your index.html file. However, if you can make it work with a local copy of the google maps API, that is the better solution.

0 Kudos
Pamela_H_Intel
Moderator
2,117 Views

Andre,

alert is not implemented on Windows. But Paul wrote a shim that is on github (github.com/xmnboy/xdk-win8x-compat.js) - you can use that to make the alert function work.

0 Kudos
André_V_
Beginner
2,117 Views

Thanks Pamela, I'm using xdk-win8x-compat.js in my app. All alerts that I put in my project are working, but I did a test with a external file with a alert just to test if the application can read external files. If I put alert inside my code works fine. The problem is external file like google maps api ou maybe bing api. I resolved my problem using another map called Leaflet . Only in windows phone my app will use this map.

0 Kudos
Valerio_P_1
Beginner
2,117 Views

Good evening,
I tried to include the google maps API in local file js, the difference is that now the app does not crash but the problem is that the map can be seen in part and you can not interact with it.


I also tried to add the following rule CSP:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; frame-src *;">
But the result does not change.

A static map that displays bad and that is not interactive is useless, possible that nobody has solved this problem?

0 Kudos
Pamela_H_Intel
Moderator
2,117 Views

@Andre - I am glad that leaflet is working for you.

@Valerio - If you do not need any particular Googlemaps functionality, you can try Leaflet as well.

0 Kudos
Dev_A_
Beginner
2,117 Views

Hey everyone,

I have developed an app which is working smoothly on Android and iOS operating system. But it crashes on the windows os after splash screen.

Technologies used : Html5,CSS3,jquery,ajaxand js.

Secondly I have to publish the app on windows store before it can be tested on the device and fails on certification is there any alternative way by which we can test the application by ourselves before publishing it on the windows store.

I am new to mobile apps development please want to know the reason why i am able to run my app on android and ios os but not on windows os.

Thanks & Regards,

Dev 

0 Kudos
Jerroyd_M_Intel
Employee
2,117 Views

Hi Dev A.,

If your windows app crashes after the splash screen, it's because an unhandled JavaScript exception is being thrown initializing your code. Be aware that jquery (and other dynamic JavaScript libraries) will not work if you do not include the xdk-win8x-compat.js. Have you included this in your project and initialization code?

--Jerroyd

0 Kudos
Dev_A_
Beginner
2,117 Views

Hey Jerroyd,

 

Thanks for your response i have not used xdk-win8x-compat.js in my project but  i have included winstore-jscompat.js  .

Is it necessary include the js which you have suggested me?

 

Thanks

Dev

 

 

 

0 Kudos
PaulF_IntelCorp
Employee
2,117 Views

Dev -- xdk-win8x-compat is a superset of winstore-jscompat. If you have any alert() calls in your app they will cause your app to hang, because Windows webviews do not support the alert() function (it is an optional feature, not a required feature). So xdk-win8x-compat also includes a replacement alert() function, in addition to a copy of winstore-jscompat. Take a look at the readme of xdk-win8x-compat for more details.

0 Kudos
Dev_A_
Beginner
2,117 Views

Hi Paul,

Thank you for your response . Please let me know which .appxupload should i upload on windows store as the windows build generates a zip which contains anycpu and appstore folders . 

Thanks & Regards,

Dev.

0 Kudos
Jerroyd_M_Intel
Employee
2,117 Views

Hi Dev A.,

To answer this question you posed earlier:

Secondly I have to publish the app on windows store before it can be tested on the device and fails on certification is there any alternative way by which we can test the application by ourselves before publishing it on the windows store.

When you build the application, it creates an appxupload file as well as a Test folder. If you right-click on the ps1 file and run it, it will install your windows application on your computer, this is a great way to do validation before submitting your application to the windows store.

0 Kudos
Dev_A_
Beginner
2,107 Views

Hey Paul,

Thnaks  for the link .Still it is not cleared which folder to select when we extract the windows build zip file either to go for "APPSTORE" or "ANYCPU".

Regards,

Dev

0 Kudos
Dev_A_
Beginner
2,107 Views

Hey Jerroyd,

Thanks so much for response.

 

Regards,

Dev

0 Kudos
Reply