Xamarin: Unable to upload Archive to AppStore - xamarin

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".

Related

Xamarin WatchOS error when sending app to App Store "The WatchKitSupport2 folder is missing"

I am using Visual Studio and Xamarin Forms to create watchOS app. When I send already built app, using Organizer in XCode I got information:
"ITMS-90484: Invalid WatchKit Support - The WatchKitSupport2 folder is
missing. Rebuild your app using the current public (GM) version of
Xcode and resubmit it. "
My ipa file contains Payload folder and WatchKitSupport2 with WK file inside. I have and rebuild solution. What should I do to fix it?
I am aware of this https://github.com/xamarin/xamarin-macios/issues/9618
Visual Studio for Windows is broken in version 16.10.4 and 16.11.7 - it is not creating folder "WatchKitSupport2" (next to "Products" folder in with "WK" file inside). Finally I have found a workaround to solve this issue by copy whole project from Windows to Mac, open it in Visual Studio for Mac, build (it creates "WatchKitSupport2" folder) and use Transporter to send it to Apple.

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.Mac installer not working

I have a Xamarin.Mac solution that runs correctly in Debug or Release build from within Xamarin Studio, but I am struggling to create a working installer for it.
I want to use direct distribution (outside the App Store), so this is the procedure I used to create the installer:
Within the Apple developer portal:
Created "Developer ID" application and installer certificates
Created an App ID for the app
Created a provisioning profile that references the App ID and the
application certificate
Downloaded the 2 certificates and the provision profile
On the development Mac:
Double-clicked the 2 certificates and verified that they were
installed in Keychain Access
Double-clicked the provisioning profile and verified that it was
installed in Profiles
Within Xcode:
Opened Preferences > Accounts and downloaded the provisioning profile
Restarted Xcode to propagate the downloads to Xamarin Studio
Within Xamarin Studio:
Configured the Bundle ID in info.plist (to match the App ID)
Selected the Release build signing identity, as created above
Selected the Release build provisioning profile, as created above
Selected the Release build installer identity, as created above
Rebuilt the solution in Release build configuration
After the build is complete, the bin/Release folder contains everything I would expect, including the .pkg and .app files.
If I double-click the .pkg file, it appears to correctly execute the installation sequence, but the installed app is not listed in Applications or Launchpad. Moreover, if I run the .app file from its bin/Release folder, it executes correctly, but if I manually move it to the Applications folder, it crashes on startup.
Within Utilities > System Information > Software > Applications, I can see that the app was installed and that its source is an "Identified Developer", so this seems to confirm that the signing worked correctly.
I'm puzzled why, if it was correctly installed, I am unable to run it.
Sorry, I am quite new to both Mac and Xamarin.Mac, so I am not completely sure what I should expect to see here, but I assume it's more than I am currently seeing.
Any clues please?
Likely if you are able to run an application locally but not able to via an installed package, you are running into code signing issues.
As noted here you could try running your application from the command line:
Run your application from the command line and look at the output (in
the Terminal app) by using: MyApp.app/Contents/MacOS/MyApp (where
MyApp is the name of your application)
and see if you are getting a code signing specific error on launch.
If so, then possibly your machine may not be on the provisioning profile/certificate selected.

How to create a binary from a monogame project

I'm making a simple Pong game on a Mac using Xamarin and Monogame, however I can`t find a way to export into a binary such as a .exe or a .app. Can it be done?
The answer is yes.
The procedure is pretty similar on both Android and iOS.
Android
Switch your project over to Release mode
If you are using any Google Play Services (maps and such), make sure to use your own keychain, which can be defined in the Project Options under Android Package Signing
Build the project
Right click and select Archive for Publishing
A new window will appear where you can sign and distribute your app
Upload to Google Play Store or any other relevant store
For iOS the steps are similar
Make sure you have created an App Name and provisioning profiles in the Apple developer center
Make sure Identifier of your app matches the registered one in the Info.plist of the app
Switch to AppStore or Ad-Hoc depending on the way you want to distribute your app
Build your project
Right click and select Show IPA on Build Server (Visual Studio) / in Xamarin.Studio on Mac you can select Archive for Publishing and get the IPA.
Upload the IPA to iTunesConnect or HockeyApp or whatever distribution method you are using
For more in depth documentation, please refer to Xamarin's official documentation for Android and for iOS.
Sorry for not quite understanding your question at the first time.
If you build the game on a Mac, I am not sure there is a way to export .app. However, I recommend you load your Xamarin project into Xamarin Studio or Visual Studio on Windows. Then you can get the iOS version and windows binary at the same time. However, for windows version you could only get .appx output, which is the winRT counterpart to the traditional desktop .exe.
Take Visual studio as an example,
If you want to export windows output, please follow steps below:
right click on your project's xamarin.Windows(UWP or Windows8.1) folder and select "store"
Select "No" for the prompt dialog about whether to upload to store
Follow the instructions till the end. Then get the .appx file under your project's AppPackages folder
And what's more, even if you just need to share with several people, HockeyApp is still a good option for you regarding the distribution trouble and version control trouble it can save for you. You can take a trial here.
Please let me know if this can help.

Can't Launch app on iOS Simulator in Xamarin Studio Mac

Been tinkering with Hanselman.Forms on my Mac with Android. Today I decided it was time to try it on the iOS Simulator...
I have serious regrets about this decision.
I'm not sure what I'm doing wrong. I'm able to deploy an app from Xcode to the iOS Simulator just fine. Just won't work from Xamarin Studio.
In all fairness I do get an error:
No installed provisioning profiles match the installed iOS code signing keys.
I do see this "error" in Xcode as well, but it doesn't prevent me from launching the app there.
Thanks.
Removing entries from Entitlements.plist worked. I also had to delete the original device Xamarin Studio was trying to deploy to. After I did, Xamarin Studio created another device and launched the application successfully.
https://forums.xamarin.com/discussion/comment/117465#Comment_117465
To the exact error message:
No installed provisioning profiles match the installed iOS signing identities
control click Xamarin Studio > Solution > Project.iOS
Options > Build > iOS Bundle Signing > Custom Entitlements
Select and delete Entitlements.plist text entry. In other words, do not click on the ... button to select new new file, nor bother editing the entitlements by hand)
OK, Build > Rebuild All.
I ran into the same when I was trying to deploy to the simulator without a physical device configuration. My fix was to:
Close Visual Studio
Open the .csproj in NOTEPAD
Find the line with CodesignElements and delete it
Save the .csproj
Reopen the project in Visual Studio
Right-mouse your IOS project and click "Rebuild
All", you should see "2 Succeeded"
Give it a run, and your app will come up on your Mac
Good discussion of this here -
http://forums.xamarin.com/discussion/39534/cant-build-ios-in-xamarin-studio-5-7-1-through-5-9
Good luck

Resources