I'm working on a project using Xamarin to build an app for WinPhone and Android.
On the Android device, it works fine.
When I try to run the app on the WinPhone device, the app starts opening and then it closes. On the console I see "TaskHost.exe has exited with code 0."
I don't see any error.
A guy that was working on it before, was using the WinPhone device without problems.
When I started working on it, the only thing I needed to change was the SQLite.WP80 version. He was using 3.8.7.1 and my VS only provided 3.8.8.1.
Has anyone faced a similar problem?
Or how can I see what is wrong? In the console output there is no errors.
I've added a breakpoint in the begining of WinPhone, but it doesnt't arrive there.
Thanks in advance!
Have you changed your namespace? Check if the startup object in the project setup is set accordingly.
Finally I found the problem.
By returning the code revision, I found one where the WinPhone project was working on phone.
Then, I started looking for differences.
Someone renamed AppWP.xaml to AppWinPhone.xaml.
Then, on project properties > startup object, it was blank.
I just set the object back and it worked.
(Why not an error message saying what is wrong...)
Thanks!
Related
Can someone please explain what's going on with my newly created Xamarin Xaml Portable project? When in "Debug" the application terminates immediately as soon as I lunch it -- like the gif above.
When in Release, it runs -- like the gif below
I like to understand what's going on between Debug and in Release why when in Debug, it terminates immediately but not in Release.
My phone model is Oppo A37F - Android 5.1
Another confusion is that, I have a Samsung Galaxy S DUOS 2, that is flashed with a custom fimrware - Android 6 (Marshmallow) - I am not facing the Debug/Release issue with this one.
Turning off/on my PC and Android devices does not help as well.
Thank you
and so I got it to work. Thanks #Smit for the direction
I have to set "Sdk Assemblies Only" in Debug.. The default setting is set to "None"
Clean your solution then uninstall the application on your device or emulator
and deploy your solution, that solved my problem.
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 getting a System.MissingMethodException error after updating Xamarin.Forms package for Android Mobile App.
In MainActivity.cs line #22:
LoadApplication (new App ());
Application Output:
[] Missing method Android.Runtime.JNIEnv::StartCreateInstance(Type,string,JValue*) in assembly Mono.Android.dll, referenced in assembly /storage/emulated/0/Android/data/XAMLDataBindings_PCL.Droid/files/.__override__/Xamarin.Android.Support.v4.dll
I have tried Clean & Rebuild All as mentioned on the Xamarin forum but still not working. The project works for iOS so not sure why Android project won't run now?
I also had the same problem today. I removed all Xamarin.* NuGets from the Android project, re-installed Xamarin.Forms and it fetched the previous versions of Xamarin.Android.* NuGets, which is 21.0.3.0. All is working fine now. I am waiting for a fix.
I had the exact same error. Solved it by Upgrading instead of Downgrading which is a bit nicer.
'Xamarin Studio' -> 'Check for Updates'
Answered: "Up to date"
But when looking at the Solution tree at the left of the screen under your xxx.Droid project it wrote that the 'Packages' had some updates.
After opening the 'Packages' folder it tells you exactly which package can be updated.
Right click -> Update.
I updated the Xamarin.Android.Support.v4
It worked.
Enjoy.
I got this exception just for iOS simulator, cause I use tablet device for Android debugging. Eventually I found it just happened when computer had no Internet access.
So I think the real reason is: there is an exception caused by network, but Xamarin Studio can't give the real detail, and just can give a stupid fake exception like "System.MissingMethodException: Attempted to access a missing method."
In my case was the FloatingActionButton cause the problems!
FAB.Droid.FloatingActionButtonRenderer.InitControl();
I have created my first Today View extension that just displaying some texted it retrieves from a shared NSUserDefaults. It works perfectly and is ready to be shipped based off of how it displays and works through simulator, but when I try to run it on my device nothing happens.
The widget shows up in notification center but it has no height. I run my main app from Xcode and it wont let me attach the debugger to it and none of my breakpoints, nslogs get hit.
I tried running the Today View target on device and I can't get the provisioning profiles to be accepted. I also tried attaching the process of the today view to the debugger with the full bundle ID and it never attaches no matter wether I open notification center or not.
Im very new with extensions and have searched a ton around for an answer to this but cant find anything that worked.
Any help would be greatly appreciated, thanks.
and in my case i tested on SDK 8.2 and my test device running on 8.1.1 totally forgotten about Deployment target changing to 8.0 worked like charm..Might be helpful for the one careless like me..
For anyone that may stumble upon this all I had was add arm64 to the list of acceptable architectures and it worked
In your widget build settings set the architectures to armv7, arm64
see this post iOs today extension do not launch - lost connection to device
I ran into problem with testing my app on iOS and Xcode when I am uploading it to my actual devices (iphone and iPad), and I'm wondering if someone knows the issue and can help me out:
Normally when I build my app on my devices, the app is installed and launched on my devices. But as I am preparing for submitting my first app I was testing around and changing the Bundle Identifier, App ID, and Development Provisions (so the issue may have something to do with it), and now, when I try to build my app on my devices, although it's installed on my devices fine, Xcode will not launch the app anymore. Instead, I got this error message:
Error Starting Executable.
Error launching remote program: No such file
or directory.
Does anyone know what the issue is? And What is this derived data folder about?
Much thanks!
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Running App from a Clean Slate
For me the problem did not resolve until I did the following in this order:
Delete the app from the device (Do this before trying to debug again)
Quit XCode (Don't just close the project)
Delete the app build folder (example path: /Users/myusername/Library/Developer/Xcode/DerivedData/MyProject-fhkaamuyvqhubaezinqbmxbnaufd/)
Restart XCode
Finally -- Try debugging again on the iOS device
The app build folder of step 3 refers to your app's build folder that is a child of "DerivedData". To find this you can reveal your app in finder, then backtrack until you get to "DerivedData" folder and delete the folder above that like "MyApp-crazylongweirdletters". Without this step (3), I could not debug, so this is a critical step and you must quit XCode before you do this step.
For some it appears simply restarting XCode does the trick, but not for me.
I only post this answer because the earlier answers did NOT work for me. Hopefully others banging their heads will find this and get a sigh of relief. :)
Notes:
The issue started happening for me when I modified the bundle id of the app.
My code signing is and was correct. My provisioning profile was the "Team Provisioning Profile" which should work for any app id (default for "iPhone Developer" automatic profile selector).
I was doing a DEBUG build (not release / distribution).
You cant debug (start from Xcode) an application signed with a distribution profile if I remember well... And then you get such messages, gdb failling to attach to process.
I finally found my error!
I was playing around with my info.plist file, and I changed the Executable Name and Bundle and Bundle Display name! As soon as I changed those back to the Defaults (EXECUTABLE_NAME, PRODUCT_NAME, PRODUCT_NAME respectively) it worked perfectly.
Delete the app from the device (tap-and-hold then delete) and try again.
For me, none of those worked. Same error, but different solution.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
The fix was simple - drop the deployment target to below or equal to the ios software version on my phone :)
I got the same error by not having my code signing correct.
Go to your project > Targets > Build Settings > Check code signing for debug state.
I stumbled upon this as a solution to another issue whch was a warning when trying to build an app on a new 4.3.5 device.
If i set the profile to distribution I do not get a warning message when building the app, but the debugger will attach to the device.
If i set the code signing to the distribution profile, i get no warnings in the build process, but the debugger will not attach. So the answer above about being signing based seems to be correct. This might also only be an issue on newer 4.3.5 devices with xcode
Product -> Clean in the menubar
This error some times happen due to incomplete "Restore" or "Sync" process of your device which keeps the .app files locked up.
What I did I had to jailbreak my device to go find the app under /User/Applications/XXXXX-XXXX-XXX/ and phisically delete the .app
For one of the apps it worked and for other one I realized it just does not run GDB automatically so the error message is totally misleading, so I set the GDB to manual and it worked and did not give me that error, but of course I have to run the app manually for the debug session to start.
It also may have required some other stuff that I did before like checking the provision profile, but this was the last step that made it work.
Before this I tried all the solutions did not work for me, and obviously simply deleting the app by holding down your finger on the screen did not work, as it removed the icon but all the files were still there. ( Since it was a development app not a downloaded App Store app )
had same problem,
quit the XCode...delete app from device...run the program again..
i solved that way..one of my friends had to restart the device.
I have the same problem. I solved it by changing the project's directory name and then launching the app again.
I had this problem on a recently restored device where my in-development apps had not been reinstalled—they were showing up on Springboard as "Waiting" to be downloaded from the App Store. Deleting the app from Springboard fixed the problem.
I've faced this issue since yesterday on two different devices, both iOS 4.x. Deleting the DerivedData folder, deleting the app, restarting the Xcode, and cleaning the code did NOT work. Repeating all the steps, in addition to rebooting the device fixed it for me.
Here I am posting an update to the issue. Might be helpful for someone with the same problem. I have Xcode 4.4 and launched it on a device with iOS 5.0 . If Xcode doesnt have the 5.0 simulators