Showing posts with label DeBug. Show all posts
Showing posts with label DeBug. Show all posts

StartActivityForResult | OnActivityResult Deprecated in Xamarin Android

Along with androidX support StartActivityForResult and OnActivityResult got dprecated inside Fragment. Here we can see the one of the alternate approach for this deprecated api's in xamarin android.

Below code snippet explains the handling the above mentioned deprecated API's:

Bug : Java.Lang.NullPointerException,Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isMutable()' on a null object reference

I have observed this above mentioned bug keeps on hitting when using Xamarin form,UI control "Frame" for android while it executes without any issues for iOS. 

In my previous post discussed about Frame border highlight issues in android. Frame control still has one or other problem with android and still remains a question mark why Xamarin team has not given any fix for this android specific problem.

How to fetch android sqlite db file from device in Mac Xamarin/Visul Studio.

Here i'm going to share one of the simple method to fetch sqlite database file from android device for xamarin or visul studio installed in mac machine. 
Recently when i was checking data stored in the sqlite db from android device, i couldn't do it easily as i fail to run ADB commands from my terminal.

Same if you are fetching DB file from Emulator it is pretty straight forward. 
Launch Device Monitor(Tools-> Device Monitor) 
select Emulator from left pane
select File Explorer from right pane 
Navigate to app data base file-> /data/data/com.appName.MyApp/databases/
Select required database file->"Pull a file from device" option from top right as shown in screen
Copy DB file to machine storage and open using sqlite db browser(http://sqlitebrowser.org/)

To fetch DB from android device using Windows machine we can use the following ADB command

ResolveLibraryProjectImport task failed unexpectedly in release mode in xamarin

This above mentioned error i got during my xamarin form project deployment in release mode. 
In my solution i have more then one project and this error indicates that linking between these project has been broken. If you are facing the same issue, then here i have listed out few scenarios that could help you to solve this issue:


1. Select the project in which error is pointing and Check the reference of other project and package. Reference with yellow triangle icon shows the broken reference. just delete it and re-add.
For any other project reference included in the current project, delete the current project reference and add the new one from release folder of that respective project.
 Or
Open "Configuration manager"



Error retrieving parent for item: No resource found that matches the given name...

This is the one of the frequent error we will get during Xamarin android/Form development. Here i have posted the resolution steps for this error in both windows and Mac machines: