Can't run android emulator - visual-studio

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):

Related

Xamarin: Unable to upload Archive to AppStore

Visual Studio 2019 (Windows) /
Xamarin 4.7.0.968
I create an iOS Archive (with no errors) but when I choose Distribute / AppStore and select the ID/Profile that I have already set up in Visual Studio, I get prompted for ID/Password as expected. But then it fails with the error:
AppStore bundle validation failed for archive MyApp.Mobile.iOS
"altool" exited with code 1.
Does anyone have any ideas what may be wrong?
Uploading to the App Store didn't worked for me following these instructions and using Visual Studio 2019 (16.7.1). I always got
Errors
App Store bundle validation failed for archive XXX
"altool" exited with code 1
We are unable to create an authentication session.
Apple mentions three ways for uploading:
Xcode
altool
Transporter app
The easiest way is to use Xcode. When you have build for Release and archived your application (in VS 2019 on your Windows machine), you can do this on your Mac in Xcode: Window > Organizer > Archives > Distribute App
Unfortunately, the upload from VS doesn't give you proper message why the upload fails. In order to debug it, you need to upload it "manually". The steps are:
Build your project in Release configuration
Right click on the iOS project and select Show IPA file on Build Server
A Finder window will open on the Mac with the ipa file being preselected.
Copy the file to some location that you can access easily (e.g. your Dekstop)
Open the Terminal
Write the following command: xcrun altool --upload-app --type ios --file "path/to/application.ipa" --username "YOUR_ITMC_USER" --password "YOUR_ITMC_PASSWORD"
If your application is on the Desktop, the path will look like this: ~/Desktop/application.ipa, where application.ipa is your app's name. Of course, you have to provide your credentials instead of YOUR_ITMC_USER & YOUR_ITMC_PASSWORD .
When you have run this command, wait a minute or two. After a while the tool will tell you if the upload fails and if so - why exactly.
P.S. You can also use the GUI Transporter app, but I don't know how much more information it may give you.
Make sure:
You use App Specific Password.
Make sure you INCREACE THE VERSION AND THE BUILD NUMBERS in info.plist
I used the Transporter App because nothing else was working. The upload failed again, but Transporter actually showed a great error message... my build version number had to be updated in Info.plist (oops!).
After updating the version number and re-archiving, the Distribute button worked as intended.
To use the Transport App
Download Transport App (made by Apple) from App store and open it on the mac
Build the iOS project in release mode on Visual Studio
Right-click the iOS project in Visual Studio and Show IPA on Build Server
If Show IPA on Build Server is greyed-out/disabled navigate to the file directly on your mac instead...
Open Finder
Click Go > Go to Folder... on the toolbar
enter ~/Library/Caches/Xamarin/mtbs/builds/
Continue navigating to the release folder... {app name}/bin/{iPhone}/Release
Find the file with the .ipa extension
Drag the IPA file into the open Transporter app
Click Deliver
If failed, click the Issue button to see why
With the most recent VS 2019 on Windows and Xcode on Mac, Show IPA file on Build was not highlighted nor was the icon for it in the menu bar. But when I launched VS again the both were highlighted and the folder displayed on the Mac when executed. Perhaps there is a latency problem with VS where you need to restart it for the feature to work.
I got this (fairly cryptic) error message when I was using an incorrect "App Specific Password".

Xamarin.Ios App terminates while starting (in Simulator and iPhone) only stating "The App has been terminated"

I am developing a Xamarin App for Android and iOS on windows. For iOS compiling, I pair with a Mac Mini.
I was forced to update MacOS, XCode, VisualStudio for Mac and therefore Xamarin. On Windows I also updated from Visual Studio 2015 to 2017.
After the updates, Android version works still fine.
The iOS App pairs, compiles and provisions successfully, but whe the App starts (either on simulator or real device), it shows the launch screen and after a few seconds quits back to home screen. It even says "successfully launched" but then terminates
The only logs I get are:
"The app has been terminated" -> on windows, in Debug Window
"Service exited due to SIGABRT" -> on mac, in simulator log file
I searched the web and tried lots of stuff:
Delete obj and bin folders
Clean, Rebuild, Restart VS, Restart Mac, Restart PC, Restart....
Deleted all Provisioning Files and Certificates, recreated them
Used Automatic provisioning, used Manual provisioning
Debug and Release Configuration
iPhone Simulator and Real Device
Sadly nothing worked and I cannot get more info why this happens.
Does somebody have or had the same issue and found a solution? Do you have suggestion what more I can try?
I would really appreciate any help.
Thanks
Edit:
As requested, a Screeshot of my build properties:
I am having the same issue. Restarting the device seems to be the only thing that works, but it's unreasonable to have to restart the device every time I want to run the debugger.
So I finally solved the problem...
I created a new iOS-Project from scratch, added the existing Xamarin.Forms project and copied the files from the original iOS project one by one. I also downgraded all firebase plugins from 5.x versions to the highest 4.x versions and xamarin forms from 3.x to 2.5.x and now the app runs in the simulator and bundle signing works also.
Thanks for your help, I hope my answer will help anyone with similar issues

Xamarin Studio do not start after install

Trying to install and run Xamarin Studio on my Mac, unfortunately this is not going well, please help. I have 7 years cross platform and app development behind me so I should now the basics.
I downloaded Xamarin Studio for Mac on the site, a dmg file was clicked and installation begun. I have gone through all steps and after problems with disk space (25 GB??) it was done.
Moving on to start Xamarin Studio and nothing happens. Absolutely nothing. I tried reboot my mac, I tried several times to start, but nothing.
(It was installed and required to enter my Admin password so it should have been installed as admin)
I use Yosemite 10.10.5 at the moment
I have Xcode installed version 7.1.1
I have Android SDK installed from before (but now also a new SDK :( )
When I read at the site there are not consistent information, at the requirements overview it says latest Xcode is required, on the actual table it is recommended. Anyone know if this is ACTUALLY my problem?
I have a problem to upgrade at this point as it can produce production problems for the deliveries I am about to do this week, at the same time I need to have Xamarin started.
Have anyone been running Xamarin with Xcode 7.1.1?? And build apps to iOS?
I was kind of expecting Xamarin Studio to at least start and let me know.
By the way I have been trying to find the answer here but cannot find anything, also at Google of course, let me know if you know a resource..
Hope I was enough specific
1) Open Console.app, "Clear the Display" and launch Xamarin Studio and review the Messages for failures/issues
2) Open a shell (Terminal or iTerm2) and run Xamarin Studio and review any messages shown. A properly functioning Xamarin Studio launched to it's main window this way will not produce any messages in the shell.
/Applications/Xamarin\ Studio.app/Contents/MacOS/XamarinStudio
3) Check the Xamarin Studio logs:
cd ~/Library/Logs/XamarinStudio-6.0/
rm *.log
/Applications/Xamarin\ Studio.app/Contents/MacOS/XamarinStudio
Review any .log files created
Xamarin System Requirements:
macOS
I'm running El Captain 10.11.6 and what solved the problem to me was to follow #SushiHangover's step 2 that is to open Terminal and run Xamarin from the cli, then I got this:
$ /Applications/Xamarin\ Studio.app/Contents/MacOS/XamarinStudio
Cannot open assembly '/Applications/Xamarin Studio.app/./XamarinStudio.exe': No such file or directory.
After that I googled it and read this bugzilla thread that made me remove Xamarin Studio app:
$ rm -rf /Applications/Xamarin\ Studio.app
And and reinstall it from the original installer.
All worked fine after this. :)

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.

Error message: "ensure that the target device screen is unlocked" when using emulator

Anyone knows why I get the error message when debugging on emulator : "the application could not be launched for debugging. Ensure that the target device screen is unlocked and that the application is installed." while Developing in Visual Studio 2010.
I've Googled it through and try the solution, but still not fixed my problem.
Btw, my solution type is SLXNA so, there are 3 projects in there, the main project, lib project, and libcontent project.
What I've tried :
Set the main project as the startup project
Checked the build and deploy check box for the main project and checked the build checkbox for the lib project
Change active solution platform to Windows phone
Rebuild solution
But it's still didn't fixed the problem
But when I debug it on device, it runs smoothly
Anyone knows how to fix this?
Make sure that the project you want to run is set a default Startup
project
Make sure that in dropdown on top you have selected "Windows Phone
Emulator", not "Windows Phone Device"
And the most important is: click on an arrow pointing down near
the Debug/Release configuration and open Configuration Manager...
Make sure that the checkbox is checked in a column "Deploy" next
to your project name.
good news : i've solved this by simply installing the windows phone sdk 7.1.1
In case some WP8 developers stumble upon this:
I've seen the exact same error message on VS 2012 with a WP8 app. However, it worked when I switched to Visual Studio Express for Windows Phone (comes with the SDK).

Resources