on
02 Jan 2024
10:00 AM
- edited on
02 Jan 2024
10:54 AM
by
MaciejNeumann
If you can't resolve a problem with the Dynatrace Xamarin NuGet package for your mobile applications, please contact a Dynatrace product expert via live chat within your Dynatrace environment. Have the following details available:
dynatrace.config.json
fileIf your build fails, make sure you've added the dynatrace.config.json
file to the Assets
(Android) or Resources
(iOS) directory and that the file includes at least the beacon URL and the application ID properties. For details, see Configuration file.
If you use the manual startup, don't include the beacon URL and the application ID properties in the configuration file. If you do that, you encounter an exception.
The following error might occur in older Xamarin Android or iOS projects.
Android
Target DynatraceAndroidBuildVerify:
dotnet "/tools/netcoreapp3.1/Dynatrace.Xamarin.Build.Android.dll" verify config="obj/Debug/assets/dynatrace.config.json" java="/Users/<user>/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25/bin" dynatraceJar="/tools/java/instrumentor-cli-8.223.1.1003.jar"
Could not execute because the specified command or file was not found.
iOS
dotnet "/tools/netcoreapp3.1/Dynatrace.Xamarin.Build.iOS.dll" "Debug"
Could not execute because the specified command or file was not found.
MSBuild
command can't resolve the package directory because the .csproj
file references Dynatrace Xamarin package dependencies individually and not as a package..csproj
file, and remove all Dynatrace Xamarin package .dll
references. For example, remove the following code for iOS:
<Reference Include="Dynatrace.Xamarin.Abstraction">
<HintPath>..\packages\Dynatrace.OneAgent.Xamarin.8.x.x.x\lib\xamarinios10\Dynatrace.Xamarin.Abstraction.dll</HintPath>
</Reference>
<Reference Include="Dynatrace.Xamarin.Binding.iOS">
<HintPath>..\packages\Dynatrace.OneAgent.Xamarin.8.x.x.x\lib\xamarinios10\Dynatrace.Xamarin.Binding.iOS.dll</HintPath>
</Reference>
<Reference Include="Dynatrace.Xamarin.iOS">
<HintPath>..\packages\Dynatrace.OneAgent.Xamarin.8.x.x.x\lib\xamarinios10\Dynatrace.Xamarin.iOS.dll</HintPath>
</Reference>
.csproj
file. Add the actual package version as the value of <Version>
.
<ItemGroup>
<PackageReference Include="Dynatrace.OneAgent.Xamarin">
<Version>8.x.x.x</Version>
</PackageReference>
</ItemGroup>
Rebuild your project.
If you notice that Dynatrace doesn't report crashes for Android applications to your environment, make sure that you're not using the debug option in Visual Studio.
Right-click your Android project, and select Properties.
Go to Android Options, and clear Enable developer instrumentation (debugging and profiling).
Disable developer instrumentation
Keep in mind that clearing Enable developer instrumentation disables debugging. Use this option only to verify that crashes are sent. Optionally, you can create a release build that is detached from Visual Studio.
WebRequestTiming
object for AndroidWhen you use the third-party modernhttpclient or modernhttpclient-updated library together with SSL pinning via the NativeMessageHandler
, the following exception might occur:
Cannot access a disposed object.
Object name: 'Dynatrace.Xamarin.Binding.Android.WebRequestTiming'.
To resolve this issue, change the default Mono Garbage Collector bridge implementation from tarjan
to new
. Check this Microsoft blog post to learn about different Garbage Collectors and understand how to change them via the environment.txt
file.