I am trying to compile and run an app that is working fine in the iOS simulator, but with Android I'm receiving
"System.MissingFieldException: Field 'Xamarin.Forms.Slider.MinimumTrackColorProperty' not found."
when trying to put it through the simulator.
Any idea why it doesn't like me setting the MinimumTrackColor?
It looks like the stable version of Xamarin.Forms for Android doesn't include that property.
I've upgraded it to the development branch, and now it doesn't throw an error but the colors are still off. I'm guessing this is just part of the dev process of the nugget.
Thank you, SushiHangover.
Got an app and works on Android and iOS.
There's one particular page in the app when I visit crashes in the production version of iOS app. Works fine in the emulator, works on the device in debug mode.
I narrowed it down to nativescript-imagepicker plugin. Even though no plugin specific code is being executed when the page is opened - it crashes as long as include the plug-in and have the code in a function (not called). If I comment out the code (but still include the plugin) - that works also.
What could cause such a problem?
Does the NS back-end run some code if the plugin is referenced in the page file?
Again works fine in emulator on iOS and also when tested directly on the device.
The problem occurs when the app is downloaded from itunesconnect - so there's no way for me to test it - console messages etc.
Using NS 3.2 with nativescript-imagepicker 0.3.6.
In my cross-platform app I save application properties in the following way:
Application.Current.Properties["myValue"] = "Test";
await Application.Current.SavePropertiesAsync();
I then retrieve them later like this:
string myVal = Application.Current.Properties["myValue"];
This works perfectly when using the Android emulator. I can close the emulator down, and when I restart it again, my app data is preserved.
However, when I deploy this app to a physical Android device, data preservation works as expected until I close the app and open it again. At this point I retrieve an empty value. It's as though the data is only saved to memory (and not to file).
Furthermore, the iOS version of the exact same app works faultlessly. When I open the app up, all previous values have been saved and I can retrieve them.
What am I doing wrong on the Android version? Is there an Android setting, permission, or option which I need to enable to have the values saved between app sessions when actually deployed to a phone?
I had a similar problem where only the debug version saved Properties. I think we're still waiting for the bug fix, and this is the workaround on Xamarin Forms bugzilla.
In short: go to .Droid project settings -> Android Options -> Linker
and enter/add "System.Runtime.Serialization" to Skip linking assemblies.
Wow! After lots of research, I have getting solution for same issue in mine. Problem is that, when i store List or DataTable in Application.Current.Properties then all properties are removed after reopen app but if i store List or DataTable as serialize, it working fine.
In VS you need to enable the option:
Preserve application data/cache on device between deploys
You can find this at Tools > Options > Xamarin > Android Settings.
I don't know if this has stopped in the latest updates of Xamarin Forms, the data is available until the application is running similar to session but persistent storage does not work.
The best api I think available for this is Akavache https://github.com/akavache/Akavache.
You can read this blog https://codemilltech.com/akavache-is-aka-awesome/.
Update
There is a bug filed in bugzilla:
https://bugzilla.xamarin.com/show_bug.cgi?id=26444
I don't remember exactly which part of this solved the issue, but when I followed the instructions to prepare the Android application for release from start to finish, the issue went away. The problem occurred when debug builds were used on an Android device.
https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/
The link details the suggested settings for the Android project when releasing to device. Following these instructions should solve the issue.
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 got a problem with "deviceReady" event not fired in the combination of the following situation
1) IOS 7 (Android 4.4 tested ok)
2) Using Cordova 3.1.0 or 3.2.0
3) overwrite ( note not appending, basically changed the whole user agent string to some arbitrary string)the user agent natively following the instruction here Change Phonegap User Agent
(I can confirmed the user agent is modified by reading navigator.useragent)
4) Add org.apache.cordova.device plugin
If I removed Device plugin, but still loads other plugins like PushPlugin and globalization, "deviceReady" fired ok.
Try to step through the cordova IOS native code, but at this stage it does not reveal much.
Any help will be appreciate.
Thanks