error doesn't displaying in logcat android 6.0 - android studio 2.0 - android-6.0-marshmallow

I making a demo app in the android studio 2.0 using a cellphone that have android 6.0 and forcing an error, but while in my old device running in android logcat display the error :
Could not find method increment(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'button_plus'
In android 6.0 doesn't displat any error just close the app, there is any other config to display the errors? . Thanks a lot.

Related

Xamarin.Android Preview Problem in VS for Mac

When I targeted Android 9.0 (Pie) in Android part of Xamarin.Forms app the Preview of UI produces an error and show nothing.
Open a new Xamarin.Forms App in VS For Mac then update all of the Android Packages. After that, target your app to Android 9.0 as I described above. Finally you should run one time your app in an Android Emulator and you will see the error in Preview Tool in VS for Mac. The problem isn't in app. App is running well but I can't see preview of the UI to change things immediately.
(Error: android/view/View.OnUnhandledKeyEventListener)

Xamarin : iOS simulator : the selected execution mode is not supported for .net projects

I've just installed Visual Studio on my Mac and started my first Xamarin Forms project. I've clicked "Getting Started" for my HelloWorld, and tried to run in the iOS simulator and got the following error :
the selected execution mode is not supported for .net projects
Could anyone please explain to me why this problem appears and how to open the simulator? Android simulator works just fine.
For those having similar issues, it seems as though the Getting Started doesn’t quite work well on Mac.
Instead of using it to open the simulators, simply right click your project and run from simulator there instead.

How does a Xamarin.forms Android app opens in all the android versions?

I developed an Xamarin cross platform app and when I tried to check it on the emulator Android 8.0 - API 26 and Android 7.1 API 25 its working fine ,so I generated an .apk file and when i tried to open it on OS 7, emulator is Genymotion for Android , I am getting an alert box stating that "app.android keeps stopping ,close app " In the visual studio in android properties I selected the minimum target version as Android 5.0 (API Level 21-Lollipop) and target Android version as use compile using SDK version .
Please help me to resolve this Issue.
Thanks

Unable to target the project to android 8.0 in Xamarin Studio

I am using Xamarin Studio Professional Version 6.3 (build 863) and Xamarin.Android Version: 8.0.0.33 (Visual Studio Professional). I have installed as well all the elements for the Android 8.0 SDK through the SDK Tools but even with that, I can't target my android app to be an Android 8.0 app. In the manifest file, the target version for 8.0 is itself not showing. To make sure I have downloaded all SDK tools I created a project in Android studio and targeted to 8.0 and was able to run in successfully in 8.0 device.The following was the error I got when I run the application on 8.0 device.
Deploying package to 'ENU7N15B10002409'
System.ArgumentOutOfRangeException: Specified argument was out of the
range of valid values. Parameter name: OS version not recognized: 8.0
at Xamarin.AndroidTools.AndroidVersion.OSVersionToApiLevel(String
osVersion) in
C:\data\lanes\4469\a2163670\source\md-addins\MonoDevelop.MonoDroid\external\androidtools\Xamarin.AndroidTools\AndroidVersion.cs:line
43 at
MonoDevelop.MonoDroid.MonoDroidUtility.d__16.MoveNext() in
C:\data\lanes\4469\a2163670\source\md-addins\MonoDevelop.MonoDroid\MonoDevelop.MonoDroid\MonoDroidUtility.cs:line
416
Deployment failed, unsupported framework version '8.0'
Can you please tell me what am I missing in the xamarin studio.Thanks for your help in advance.
You need to set SDK target framework to Android 8.0 as well.
It's located in a different tab, and I suppose for a new project its set automatically to the highest depending on what you have, but since your project was created before you download the latest one, it may still target the lower one.

Android Debugging Failing With "Couldn't connect to logcat, GetProcessId returned: 0" FFImageLoading.Platform.dll.so Not Found

I am having issue debugging Android project. I can deploy to device and run it, all works fine but if I try to debug, the app gets deployed to the device and very briefly opened, splash screen shows up but the app then closes.
I am using Xamarin Forms on Visual Studio 2015.
Device is running Android Oreo (8.0.0). Another device running Android 6.0.1 is debugging fine.
The output shows following:
InspectorDebugSession(11): StateChange: Start -> EntryPointBreakpointRegistered
InspectorDebugSession(11): Constructed
Android application is debugging.
InspectorDebugSession(11): HandleTargetEvent: TargetExited
InspectorDebugSession(11): Disposed
Couldn't connect to logcat, GetProcessId returned: 0
I checked Logcat and it seem to be having issues finding FFImageLoading library:
Time Device Name Type PID Tag Message
09-18 14:35:52.361 Huawei Nexus 6P Debug 1560 Mono AOT:
image '/usr/local/lib/mono/aot-cache/arm/FFImageLoading.Platform.dll.so'
not found: dlopen failed: library "/data/app/myapp.android.dev-
WEb1bz8edgF7vwx6uCoZ-A==/lib/arm/libaot-FFImageLoading.Platform.dll.so" not found
I have added Nuget package for FFImageLoading to my projects and Droid project references show it as in image below:
This worked for me :-
Deselecting the 'Use Shared Runtime' in Project Properties > Android
Options > Packaging properties
I also had this issue with Android 8.1 and Visual Studio 2017 15.7.4.
There are three steps to got it working again.
Under Android Options, go to Advanced and add your device architecture, in my case it was x86_64.
Go to Tools -> Options -> Xamarin > Android Settings and enable: Provide debug symbols for shared runtime and base class libraries.
And the final step is to delete following Apps from your device:
All Xamarin.Android API Support libraries
Mono Shared Runtime
Your App
After these steps you don't need to disable "Use Shared Runtime" and can Deploy and Debug much faster.
This is a known issue with Oreo and Xamarin Android on Visual Studio for Windows. It works on Visual Studio for Mac apparently. It will be fixed in an upcoming release. In the mean time there is a work around down near the bottom of the bug link above (comment 20).
deselecting 'Use Shared Runtime' in Project Properties > Android Options
delete bin & obj files from solution
clean solution
rebuild the solution it works
One another reason for that is if you dont enable usb debugging on your device, VS 2017 still recognizes your phone and installs the app on your phone. Just after debugging starts, it will throw this error and not continue debugging. Make sure to enable Developer Mode -> Usb debugging like described here
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development

Resources