Xamarin.Android apk crashes after building on visualstudioonline - visual-studio

We got a Xamarin.Android project and are using visualstudioonline for building our app. When I build locally with my IDE (Visual Studio 2015) the app works as expected in Debug and also in Release mode. I tried to deploy the app directly from Visual Studio (Run) and also to grab the .apk file after a build from the bin directory. Everything works.
Now when I build the app with the build server on visualstudioonline the app instantly crashes when I launch the app on a device. Ive got another app on visualstudioonline with the same settings in my build task and there is no such problem (latest MSBuild version and JDK 8)
I only have the log from logcat because I also get no events, exceptions or crash reports on AppCenter.
The app in the log is called "preon.AndroidApplication"
Logcat log - whole logcat output
Logcat log - where I think the error is located

Related

Can't run android emulator

I installed the mobile development option for Visual Studio 2017, and created a new mobile app (Xamarin.forms) in the blank app template.
I tried to run the app, but I got the message The ADB binary found at is obsolete.
I downloaded the update from the SDK manager, and the message was gone, but now when I try to run the app, the emulator shows a black screen for a few seconds, and then the status strip shows the message Deploy canceled, and the emulator closes.
How can I fix it?
The error message is vague, you'll need to provide more information if you want someone to answer this.
To do so, you want to enable the diagnostics output in VS:
Here is a couple of things you can do in the meantime:
run VS as administrator
clean your project
go to the project folder and delete all the files under /bin and /obj
rebuild the project
Then try to deploy your application
The running process failed now because of deployment errors (after I did what Guillermo Gerard suggested):

Xamarin.Forms - Release apk not installing

I am trying to install the application as a release APK in my android device but it is crashing when the installation of the application starts. When I run the app on release mode directly from the visual studio, it is showing no error and worked perfectly.
When the same signed APK file I am trying to install in the same or some other android device it just crashed when the installation of the application starts.
The linking property of the Android project is set to None (tried with all the three options), the minimum Android version is jelly bean and maximum version is Oreo 8.1.
I am using the latest Xamarin.Forms package and visual studio 2017. My Android SDK is updated. Please let me know what corrections do I need to make in order to successfully run the APK on all the devices.
I think these are possible things which can help you
Remove the old build from mobile and restart the mobile. while releasing, delete bin and obj folders, clean the solution and rebuild the solution after rebuilding deploy the solution
In android manifest file Set target android version to (api 27) oreo instead Use Compile using SDK.
Check the permission in release mode like (Internet, wifi and other permission which your app needs).

Xamarin Forms Deployment failed

I'm working on Xamarin Forms application in Visual studio 2017 .I wanted to deploy application to android simulator .I try to deploy it debug mode.
i set android project as the startup project
When i deploying i get this warning
No Address and User has been specified in order to establish a connection to a Mac Server, so only the main assembly was compiled for project CMI.IOSApp. Connect to a Mac Server and try again to build the full application.
Go to VS menu Build->Configuration Manager is iOS project tick when you have set your android project as start up project.
So the Build and Deploy checkbox for iOS project should be untick when you are going for Android build.

Visual Studio 2017 / Xamarin fail to run app on iPhoneSimulator

** solved by trial and error, see comments **
Anyone who can help me troubleshoot the process of loading an iOS app into the XCode iPhoneSimulator?
Recently I set up the latest VS 2017 + Xamarin + XCode on my Mac Pro (MacOS 10.12.6 "Sierra"). I created a portable HelloWorld app with Xamarin, and it runs fine on the iPhoneSimulator, so everything is wired together correctly. I did also try a HelloWorld in XCode, it runs in the simulator too.
Today I loaded a sample app from GitHub, which is also a portable app supporting Android and iOS. After unloading the .Droid hive, I could successfully build it, no errors of any kind.
But if I try to run it in the iPhone simulator, the simulator starts, but then nothing happens any more, obvioulsly the app doesn't get executed, or an attempt to execute it is made, but fails silently. Other Xamarin apps appear on the iOS start screen, this one doesn't, it seems like it never reaches the simulator, or is rejected for some reason. System log shows nothing unusual. Usual steps to clean up the application and get an entirely new build (delete .obj and .bin and then rebuild all) have been tried, but no success.
Can anyone give me instructions ho I can do further troubleshooting? On Windows, I'd try to load the ready built apk into the simulator from a terminal window, sometimes this gives additional error infos, but on the Mac I have no idea how to accomplish this. What I can say though is that the build creates a ton of files in the debug directory (.exe, .dll, .pdb), but from ther I don't know how to proceed further.
The .Droid hive of the same application compiles and runs perfectly on my Windows host under the Android simulator.

Error in Publishing the xamarin android code

I am trying to publish the xamarin android code in release mode using visual studio through Tool >> Android >> publish android app option. But it's giving issue while i publish the code
I have tried again and again but code is giving issue please check the circle error message.
Before 4-5 days back i am following this procedure then it was working fine but now i am trying to publish the app then it's giving issue
Please provide me solution of this issue so that i can upload my app on google play
Try below steps:
Close the XAmarin Studio/ Visual Studio
Go to the Android SDK platform-tools directory in Command Prompt
type adb kill-server
type adb start-server.
Restart your device/emulator
Re-run your code. Hopefully it should work now.
Uninstall Java 7 jdk and install Java 8 jdk. Reboot, recompile and retry.

Resources