2
votes

The build for my mobile xamarin app hangs always at this point in the flow:

1>  Processing: obj\Debug\res\layout\homeview.xml
1>  Processing: obj\Debug\res\layout\loginnotificationfragment.xml
1>  Processing: obj\Debug\res\layout\registerdeviceview.xml
1>  Processing: obj\Debug\res\layout\registrationsucceededview.xml
1>  Processing: obj\Debug\res\layout\splashscreen.xml
1>  Processing: obj\Debug\res\layout\textnotificationfragment.xml
1>  Processing: obj\Debug\res\layout\textnotificationitemtemplate.xml
1>  Processing: obj\Debug\res\menu\homenotificationsmenu.xml
1>  Processing: obj\Debug\res\values\colors.xml
1>  Processing: obj\Debug\res\values\strings.xml
1>  Processing: obj\Debug\res\values\styles.xml
1>  Processing: obj\Debug\res\values\values.xml
1>C:\Program Files\Java\jdk1.8.0_121\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\Paul\AppData\Local\Xamarin\Mono for Android\debug.keystore" 
1>C:\Program Files\Java\jdk1.8.0_121\\bin\jarsigner.exe -keystore "C:\Users\Paul\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\
1>l.natuurnetwerk.notifier-Signed-Unaligned.apk C:\Projects\Notifier\Notifier\Notifier.Android\obj\Debug\android\bin
1>l.natuurnetwerk.notifier.apk androiddebugkey 
1>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2047-02-06) or after any future revocation date.
1>C:\Users\Paul\AppData\Local\Android\android-sdk\build-tools\25.0.0\zipalign.exe 4 "C:\Projects\Notifier\Notifier\Notifier.Android\bin\Debug
1>l.natuurnetwerk.notifier-Signed-Unaligned.apk" "bin\Debug\
1>l.natuurnetwerk.notifier-Signed.apk" 

With verbosity set to detailed this is show when hanging:

2>  EnableInstantRun: False
2>  InstantRunForceUploadApk: True
2>  AndroidSdkPath: C:\Users\Paul\AppData\Local\Android\android-sdk
2>  AndroidNdkPath: C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b
2>  JavaSdkPath: C:\Program Files\Java\jdk1.8.0_121
2>  Found AndroidSdk at C:\Users\Paul\AppData\Local\Android\android-sdk
2>  Found AndroidNdk at C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b
2>  Found AndroidTools at C:\Users\Paul\AppData\Local\Android\android-sdk\tools
2>DEBUG RunShellCommand 1015faeb8a312a02 getprop
2>TASK: GetProperties getprop completed?:[audioflinger.bootsnd]: [0]
2>[boot.sfbootcomplete]: [0]
2>[dalvik.vm.appimageformat]: [lz4]
2>[dalvik.vm....
2>[BEGIN] Detecting installed packages
2>[MESSAGE] Detecting installed packages...
2>Detecting installed packages...
2>DEBUG RunShellCommand 1015faeb8a312a02 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_25,nl.natuurnetwerk.notifier" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"

I'm stuck at the moment since the deploy does not continue:

Microsoft Visual Studio Professional 2017 Version 15.2 (26430.13) Release VisualStudio.15.Release/15.2.0+26430.13 Microsoft .NET Framework Version 4.6.01586

Installed Version: Professional

Visual C# 2017 00369-60000-00001-AA880 Microsoft Visual C# 2017

Mono Debugging for Visual Studio Mono.Debugging.VisualStudio Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 4.2.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Visual Studio Tools for Apache Cordova 15.113.6201.1 Visual Studio Tools for Apache Cordova

Xamarin 4.5.0.486 (fec6f88) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK 7.3.1.2 (9dbc4c5) Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 10.10.0.37 (ad35de4) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

2
I have some crazy error build problems with 2017 too and when i try to build on 2015 the program displayes the correct error. after i fix it the build was succecfull - CDrosos
Have you tried uninstalling from device - unplugging and replugging device - uninstall shared mono rumtime from device? - woelliJ
In retrospect it seems that it occurred after I ad-hoc installed the same .apk to the phone. I tested if it was possible to install a signed .apk from a website download and yes that worked fine. But after this install the deploy started failing. I deleted the app used ES File Manager and Clean Master to remove leftover files, rebooted PC and Phone but nothing helps. - Paul Sinnema
I';ve come to the point where I have to decide to revert to factory settings. I'm going to do that tonight. If anyone can give me a hint what might be the problem I would certainly like to know. - Paul Sinnema

2 Answers

0
votes

For others having the same problem it is worth checking out this report on the Visual Studio Developer Community site: https://developercommunity.visualstudio.com/content/problem/211740/apk-signature-fails-apksignerbat.html

There seem to be two potential workarounds:

  1. Replace the last line of the apksigner.bat with call "%java_exe%" %javaOpts% -classpath "%frameworkdir%" -jar "%jarpath%" %params%.
  2. Remove all versions of the JDK/JRE except a single instance of JDK8.
0
votes

I was using Android Pixel 3 Emulator (Xamarin) without any issues and one day it suddenly ran into this issue. After trying several options - only option worked for me was completely deleting the emulator I was using and re-installing a new emulator.

Everything is back to normal - of course you will loose all of the previously deployed apps. But for Xamarin learners like myself it isn't a big issue.

enter image description here