2
votes

for a few days I am struggling with debugging my projects. It is impossible to deploy an application in debug mode.

Application does not work either compiling UWP and Android. Compiling on UWP throws an error that debugger is attached to the process, but it hasn't been configured to debug this unhandled exception. It breaks here:

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) 
                global::System.Diagnostics.Debugger.Break();
        };
#endif

My project is in .NET Standard 2.0.1 Steps I have tried:

  1. I have tried removing VS cache (privateregistry.bin).
  2. I have cleaned project, rebuilt it.
  3. I have even manually removed bin and obj folder.
  4. I have updated and downgraded Xamarin.Forms package (I have tried prerelease and earlier versions, now I am at latest stable version)

I have created a blank project and still I cannot launch an app.

With release option it goes fine, but when I try to use debug it says

Starting Android application ... An error occured. See full exception on logs for more details. Unable to start debugging.

Cannot locate specified file. (got that in my native language, so the translation might not be 100% accurate)

I do not even know where the exception logs of that failure are being thrown. The last idea isto reinstall visual studio, however I would like not to take this step, because Xamarin, ASP.NET, unity are not lightweight parts and I am not going to reinstall VS every time something in Xamarin breaks. :-(

Has anyone any ideas how to fix that failure? Maybe you have struggled with Xamarin too? To be honest I would try to use Ionic instead of that, but have to fix it to finish my school project.

Recently I have tried Xamarin Previewer and Gorilla Player, and before that I think everything worked fine. However I have updated Windows and Visual Studio in the meantime and I am not sure what the reason is.

--- Edit - here are my logs

3>Done building project "TicketApp.csproj". 3>TicketApp.Android -> C:\Xamarin\TicketApp\TicketApp\TicketApp.Android\bin\Release\TicketApp.Android.dll 3>C:\Program Files\Java\jdk1.8.0_161\bin\java.exe -Xmx1G -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.1\lib\dx.jar" --dex --no-strict --output obj\Release\android\bin C:\Xamarin\TicketApp\TicketApp\TicketApp.Android\obj\Release\android\bin\classes.zip "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.1\mono.android.jar" obj\Release\lp\0\jl\formsviewgroup.jar obj\Release\lp\10\jl\bin\classes.jar obj\Release\lp\11\jl\bin\classes.jar obj\Release\lp\12\jl\bin\classes.jar obj\Release\lp\13\jl\bin\classes.jar obj\Release\lp\14\jl\bin\classes.jar obj\Release\lp\15\jl\bin\classes.jar obj\Release\lp\16\jl\bin\classes.jar obj\Release\lp\17\jl\bin\classes.jar obj\Release\lp\18\jl\bin\classes.jar obj\Release\lp\19\jl\bin\classes.jar obj\Release\lp\20\jl\bin\classes.jar obj\Release\lp\21\jl\bin\classes.jar obj\Release\lp\22\jl\bin\classes.jar obj\Release\lp\23\jl\bin\classes.jar obj\Release\lp\5\jl\arch-core-common.jar obj\Release\lp\6\jl\arch-lifecycle-common.jar obj\Release\lp\7\jl\bin\classes.jar obj\Release\lp\8\jl\bin\classes.jar 3>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\mono-symbolicate" store-symbols "bin\Release\com.companyname.TicketApp.apk.mSYM" "obj\Release\android/assets" 3>Directory obj\Release\android/assets contains Java.Interop.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Newtonsoft.Json.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains QRCoder.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Arch.Core.Common.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Arch.Lifecycle.Common.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Arch.Lifecycle.Runtime.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Animated.Vector.Drawable.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Annotations.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Compat.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Core.UI.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Core.Utils.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Design.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Fragment.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Media.Compat.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Transition.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v4.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v7.AppCompat.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v7.CardView.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v7.MediaRouter.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v7.Palette.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.v7.RecyclerView.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Android.Support.Vector.Drawable.dll but no debug symbols file was found. 3>Directory obj\Release\android/assets contains Xamarin.Forms.Platform.dll but no debug symbols file was found. 3>C:\Program Files\Java\jdk1.8.0_161\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\szymo\AppData\Local\Xamarin\Mono for Android\debug.keystore" 3>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.1\zipalign.exe 4 "C:\Xamarin\TicketApp\TicketApp\TicketApp.Android\obj\Release\android\bin\com.companyname.TicketApp.apk" "bin\Release\com.companyname.TicketApp-Signed.apk" 3>C:\Program Files\Java\jdk1.8.0_161\bin\java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.1\lib\apksigner.jar" sign --ks "C:\Users\szymo\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 15 --max-sdk-version 27 C:\Xamarin\TicketApp\TicketApp\TicketApp.Android\bin\Release\com.companyname.TicketApp-Signed.apk 3>Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] 3> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 3> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.b__0(Task1 t) 3> at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke() 3> at System.Threading.Tasks.Task.Execute() 3>Done building project "TicketApp.Android.csproj". 3>Build succeeded. 3>Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] 3> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 3> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.b__0(Task1 t) 3> at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke() 3> at System.Threading.Tasks.Task.Execute() 3> 3>Deploy failed on nexus

3
When deploying UWP with release settings I got Unauthorized Exception and then it navigates to the page ExceptionHelpers.cs not found with an error Unhandled exception at 0x00007FFF25CBC755 (twinapi.appcore.dll) in TicketApp.UWP.exe: 0xC000027BBubiec
As this happens at runtime, I suspect the problem will not be in VS itself. Have you installed some kind of a NuGet library into the shared project? I suspect the issue might be there. Could you post the list of packages you have installed?Martin Zikmund
Thank you Martin. I have only Newtonsoft.Json (11.0.2), System.Net.Http (4.3.3) and Xamarin.Forms (3.0.0.482510) installed.Bubiec

3 Answers

2
votes

Problem solved after a long period of time. Xamarin - never again.

Steps made towards fixing:

  1. Unchecked Use Shared Runtime option
  2. Set the app image to the stock xamarin logo (it was left empty, so I think by default it was the same and I do not know if the step had any impact on fixing that problem).

    • reinstalling xamarin vs extension - no result (next steps would be reinstalling vs and formatting my pc)

Settings changed to fix error

1
votes

In order to deploy application in Debug Mode on you device, you first need to enable debugging. Try these steps, as taken from Digital Trends:

  1. If using stock Android, go to Settings > About phone > Build number. On a Samsung Galaxy device, go to Settings > About device > Build number. On an HTC device, go to Settings > About > Software information > More > Build number. On an LG device, go to Settings > About phone > Software info > Build number.

  2. Tap Build number seven times. After the first few taps, you should see the steps counting down until you unlock the developer options. Once activated, you will see a message that reads, “You are now a developer!”

  3. Go back to Settings, where you’ll find a Developer options entry in the menu (last one).

  4. Under the Debugging title, enable USB debugging.

0
votes

With regards to UWP, you won't be able to deploy to a win 10 mobile emulator, as none of them support .net standad 2.0 - MS killed off feature updates just before the required version. This means you need to deploy to the simulator or local machine, but also means that these devices need to be running the correct OS (version 16299). I deploy direct to an Android device as I can't get an emulator to work for the life of me....