I have a Cordova iOS app that makes a call to window.openDatabase() in the onDeviceReady() event handler. It seems execution of the onDeviceReady() event handler stops on that line, because my console.log() beneath that line never show up in the debug console in Xcode. Neither do any other error messages.
The same code works fine on Android devices and Chrome/Ripple emulator. What is wrong?
var db = null;
// PhoneGap is ready
function onDeviceReady() {
console.log("onDeviceReady");
db = window.openDatabase("mydb", "1.0", "My DB", 100000000);
console.log("This will never be displayed in Xcode log");
db.transaction(checkDB, checkErrorCB);
}
Cordova version: 2.3.0
Xcode version: 4.5.2
I am testing on iPhone 5.1 and iPhone 6.0 simulator.
Doh!!
Seems the DB size I specified was to big, it all started working when I removed a zero... That's the kind of thing that's easy to overlook when you've been looking at the same code for weeks and it's been working fine. I just picked a random large number "to be on the safe side".
This code is working:
db = window.openDatabase("mydb", "1.0", "My DB", 10000000);
Related
This is my first cordova app and i'm trying to use the cordova.plugins.diagnostic plugin. I have it installed correctly i believe. On device ready I can alert that
alert(cordova.plugins.diagnostic != null) // returns true
// Appears to do nothing, i get no alerts
cordova.plugins.diagnostic.isLocationEnabled(function(enabled){
alert(enabled)
}, function(){
alert("ERROR");
});
I assume my error is with how i am running the app. I build the app via
cordova build ios
Then I run the build via xCode 9.4 to a local iPhone X
Any ideas on what i am doing wrong is much appreciated.
I have found the issue! Originally, when running
cordova build ios
I would receive and archive not found error, that i was essentially ignoring because it didnt seem to effect anything when built via xCode.
I resolved the error by running instead
cordova build ios --buildFlag="-UseModernBuildSystem=0"
Then, I can take the outputed .ipa file and install it onto my device via
Window > Devices and Simulators > {select device} > drag and drop ipa into app list
Running the app after this allowed for successfull response from isLocationEnabled!
I hope this answer helps someone else :D
I've never come across this, I have a web service call that's working on the iOS simulator just fine, but when I try to debug the same on my iPhone (7plus - 10.3.1), the application crashes and I get this very strange error. This is the call causing the the crash (I'm trying to format this as code, but it's not working at all):
var cancellationToken = new CancellationToken();
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Accept", "application/json");
var responseMessage = await httpClient.PostAsync(path, content, cancellationToken);
// CRASH OCCURS ON THE NEXT LINE
return await responseMessage.Content.ReadAsAsync<TokenResponse>(cancellationToken);
Here is the error:
System.ExecutionEngineException: Attempting to JIT compile method 'System.Net.Http.HttpContentExtensions:ReadAsAsync (System.Net.Http.HttpContent,System.Type,System.Collections.Generic.IEnumerable`1,System.Net.Http.Formatting.IFormatterLogger,System.Threading.CancellationToken)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
I don't appear to be doing anything that limitations link is describing and again it's working just fine on both the iOS simulator and Android simulator as well as my Android device. Any idea how to proceed? I can post more code if needed.
I am trying to develop a stepcounter using the ti.coremotion module.
I am trying to implement http://docs.appcelerator.com/platform/latest/#!/api/Modules.CoreMotion on devices with ios 8 and 9, but as it says in the doc, this only works for ios 7. I am stuck now. I tried running it on a device with ios8 and it said "Device does not supports step counting".
I tried searching it on google and got this: https://github.com/benbahrenburg/Ti.CoreMotion
which says it is for ios 7+ but works with sdk 3.2 only. What I am working with is sdk 4.1 and I need it as 3.2 will not work for other things.
Any help is appreciated.
I just build an app with SDK 5.0.2.GA to my iPhone 6S running iOS 9.1 and this sample code and it worked fine:
var CoreMotion = require("ti.coremotion");
// This code checks to see if the device can gather step counting data
if (CoreMotion.isStepCountingAvailable()) {
// If it can, it starts the step counter and outputs the data to the console
CoreMotion.startStepCountingUpdates({stepCounts: 1}, function(e){
Ti.API.error(JSON.stringify(e.numberOfSteps));
});
} else {
Ti.API.error('This device does not support counting steps.');
}
What device are you testing on? Does it work for you on a device running iOS 9?
If you have reproducible code/steps/environment then please create a JIRA ticket: http://jira.appcelerator.org
I'm trying to play with NativeScript to create any simple android app. I've done step 1 from NativeScript's 'Getting Started' (setting up my osx environment) and right now, i have a barebones NativeScript app created with tns create and android platform added to it.
When running tns run android everything goes well and the final message before device debug logs (i'm not an android/ios/mobile dev so i assume that it's just some kind of debug log of what's going on connected device) is:
BUILD SUCCESSFUL
Total time: 11 seconds
Project successfully built
Using /Volumes/HDD/Users/michal/Workspace/Sandbox/tns_hello_world/platforms/android/bin/tns_hello_worl d-debug.apk
Successfully deployed on device with identifier '00099fbd72369f'
However, there is nothing going on my device after that. No app is being launched, no error message. Just completely nothing.
My setup is:
OSX 10.9.5
Java 1.8.0_45
Samsung GT-I9100
Android 4.1.2
Have you any idea what am i possibly doing wrong? Thanks in advance.
Your android device is not supported by NativeScript. Use device with Android 4.2 (API level 17) or newer. You can also try it on emulator.
Jan 2019
I verified in Android 8.1, it works fine.
First look, it looks like not working.
However, after changing the text "Play with NativeScript!" to "Hello world" in home.component.html, I could see the text. The homepage message ideally should say this.
I upgraded my mac OS to mavericks and also my Xcode 4.6 to Xcode 5.1.1.
I tried to launch my iOS app which was originally built on iOS 6 in the iOS 7.1 simulator.
I get the login page as intended but as soon as the login page is displayed I get an error in the main method exactly at the below line and the execution stops there. The description says "signal SIGKILL". I am not able to figure out a fix for this as all the app delegates call back methods are called fine and there seems to be no issues with the application code. Can anyone please let me know what could be the problem here.
return UIApplicationMain(argc, argv, nil, NSStringFromClass([CommVotesAppDelegate class]));