Getting line line numbers for AppCenter Diagnostics in Xamarin.Android apps - xamarin

I am currently working in Xamarin.Android application, which is integrated with AppCenter for capturing Crashes & Exceptions. When using emulator in debug config or release config (with following properties), i could see the line numbers in Appcenter Exceptions.
<DebugSymbols>True</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>False</Optimize>
However, i cannot see the line number once the APK is generated. Few fourms suggest mapping.txt needs to be uploaded into AppCenter.
Please let me know - how to generate mapping.txt file in Xamarin.Android Project or any other alternative ways to get line numbers in AppCenter exceptions ?
Thanks

Related

.Net Maui: StorageWrite permission stops working with .net 7 on Android emulator

It worked on .NET 6, but now when I migrated my .net maui project to .net 7 the problem starts occurring: I have MediaPicker placed to one xaml page of my project in order to capture a picture and store it at the app data directory. I can run Android emulator and get permission for camera, but it stopped working for storage. I deleted and re-created Android emulator device, I tried different Android versions like API 29, 33, but nothing works. I used to pop up Android permission dialog window automatically when it executes CapturePhotoAsync, now it does not, and even when explicitly request the permission it still does not show dialog window and retuns Denied immidiatelly
// got PermissionStatus.Denied, no dialog window requesting permission pops up
PermissionStatus status = await Permissions.RequestAsync<Permissions.StorageWrite>();
If I ignore it and tries to store the picture it predictably raises the exception Microsoft.Maui.ApplicationModel.PermissionException: 'StorageWrite permission was not granted: Denied'
Anyone can suggest what could be wrong and what can I try to get it resolved
UPDATE: created min. project and uploaded it to the github: github.com/YMichurin/mauiStoragePermissions
This problem is specific to Android 13 with MAUI, and the open issue is here:
https://github.com/dotnet/maui/issues/11275
Using the Android 12 emulator or below should work.
I have done a sample to test with your code. And the permission request dialog will show after I clicked the button.
Did you forget to add the permission into the AndroidManifest.xml? Such as:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
In addition, you can create a new project with the .net 7.0 to test the code. It worked well in my project.
Update
When I cloned your project to the vs, there was some packages errors. And the project run successfully after I added the following code into the csproj.cs.
<ItemGroup>
   <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0-rc.2.22430.11" />
   <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-rc.2.22430.11" />
   <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-rc.2.22430.11" />
   <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0-rc.2.22430.11" />
</ItemGroup>
And the Result:
The console log:
The permission request dialog will show and the picture saved successfully after I granted the permission.

Xamarin Forms, Metadata Error - app used to Build just fine

My first question on the site.
I just came back to my project after 2 days, and have tried out flutter.
My app used to run fine on android, now it gives me a metadata error
Severity Code Description Project File Line Suppression State
Error CS0006 Metadata file
'C:\Users\frede\source\repos\GoogleCalendarStatistics\GoogleCalendarStatistics\bin\Debug\netstandard2.0\ref\GoogleCalendarStatistics.dll'
could not be
found GoogleCalendarStatistics.Android C:\Users\frede\source\repos\GoogleCalendarStatistics\GoogleCalendarStatistics.Android\CSC 1 Active
It may do the trick that delete bin and obj folder and rebuild .
Details refer https://forums.xamarin.com/discussion/99983/can-not-build-anymore-error-cs0006-metadata-file-could-not-be-found.

Missing Telerik files in project\obj upon window store app package creation

I've been working on an UWP app with a Telerik RadDataGrid component on it. It builds fine in debug and release mode. However, when building the windows store app package the process fails with the following reason:
ErrorFor file "C:\Projects\CompanyAppClient10\obj\x64\Debug\PackageLayout\Telerik.UI.Xaml.Grid.UWP\Assets\FilterFlyout\ic_arrow_down_white.scale-140.png" -
0x80070003 - The system cannot find the path specified.CompanyAppClient10 C:\Projects\CompanyAppClient10\MakeAppx
What could be the cause of this?
I've already tried creating a new clean UWP application with only a RadDataGrid component on MainPage.xaml. This results in the same error as above.
I've also repaired my Telerik UWP installation. Makes no difference.
Installing the newer update fixes it.
Alternatively you can use the following workaround -- copy the entire folder
C:\Program Files (x86)\Telerik\UI for Universal Windows Platform Q2 2016\Binaries\Telerik.UI.Xaml.Grid.UWP\Assets\FilterFlyout
into
C:\Program Files (x86)\Telerik\UI for Universal Windows Platform Q2 2016\SDKs\Telerik UI for Universal Windows Platform\Redist\CommonConfiguration\neutral\Telerik.UI.Xaml.Grid.UWP\Assets
Based on the error message my guess is that your app requires scale 140 assets but Telerik doesn’t provide them. You many want to contact Telerik directly and file a bug report.

How to build a Cordova app to windows 10 (universal)

I'm currently developing a Cordova application with jQuery Mobile by using sublime text 3 and using Ripple to emulate my devices (I'll reference this project as SublimeProject).
I can build apps for IOS, Android and Win8. But now I need to build it for Windows 10. Apparently this doesn't work with my setup.
A colleague of mine told me to import the project in Visual Studio (I'll reference this as VSProject), add the plugins in the config.xml, copy over the files to the www folder and run it. Problem here is that it just doesn't work.
When I try to run it on Android with the Ripple - Nexus (Galaxy) emulator, it'll give me a warning like this:
I Haz CHeeseburger?!?!
PushPlugin.register
We seem to be missing some stuff :(
What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute
Success! Fail!
But when I press Fail! the program will just work, somehow.
My console shows me the following for ripple.js:
ripple.js:37 Ripple :: Environment Warming Up (Tea. Earl Grey. Hot.)
ripple.js:51 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
ripple.js:51 GET http://localhost:4400/config.xml 404 (Not Found)(anonymous function) # ripple.js:51module.exports.initialize # ripple.js:51_baton.pass # ripple.js:13xhr.onreadystatechange # ripple.js:39
ripple.js:37 cordova :: Initialization Finished (Make it so.)
ripple.js:37 cordova :: Native back button handler was detached.
ripple.js:41 missing exec:PushPlugin.register
ripple.js:48 PushPlugin
ripple.js:48 register
Makes sense that something is wrong with pushplugin, but can't figure out what.
Additional, when I try to run the application on Windows-AnyCPU (which my actual intent is), the application will just show me the default cordova splash screen and hang there:
So that's where I'm at. I need to figure out a way to get the app to run on Windows 10. Prefered to use Visual Studio because I know it has an option to build me an .xap file.
Updates:
Update 1
I'm tracing where the PushPlugin error comes from.
try {
pushNotification = window.plugins.pushNotification;
}
pushNotification seems to be undefined, yet in my config.xml I have the following line:
<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.4.0" />
Update 2
The pushplugin doesn't seem to be relevant, because when debugging in Visual Studio, I'll find the pushNotification to be not undefined.
Currently there is nothing pointing to a good reason why I only see the splash screen instead of my application.
I had the same problem and it turned out it was due to duplicate url in the $stateProvider.

How to get Xamarin Test Cloud Device String

I am trying to use CI along with Xamarin Test Cloud for an automated CI + Execute test scenario using Visual Studio Online.
While creating a new Xamarin Android build definition, it asks to enter a value for Devices, which is quoted as
The devices string is generated by Xamarin Test Cloud. It can be found as the value of the --devices command line argument of a Test Cloud test run.
Any ideas how can I get this string & from where?
I'm using UiTest & uploaded the test to Xamarin Test cloud from Visual Studio-> Test Project-> Right Click-> Run in Test cloud
help is appreciated.
Thanks
ST
The easiest way to generate a valid --devices string is to go to https://testcloud.xamarin.com/ and select "New Test Run" which you can go through and select your devices. At the final screen named "Submit your tests to finish", you can then grab the --devices parameter value from the generated test-cloud.exe command.

Resources