cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
maliborskaya
Dynatrace Advisor
Dynatrace Advisor

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:

Failed build

If 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.

Dynatrace.Xamarin.Build.Android and iOS

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.
The Dynatrace Xamarin package MSBuild command can't resolve the package directory because the .csproj file references Dynatrace Xamarin package dependencies individually and not as a package.
To resolve the problem
  1. Open your Android or iOS .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>
  2. Add the Dynatrace Xamarin package reference to the .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>
  3. Rebuild your project.

Turn off Visual Studio Debugger for Android

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.

  1. Right-click your Android project, and select Properties.

  2. Go to Android Options, and clear Enable developer instrumentation (debugging and profiling).

    Disable developer instrumentationDisable 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.

Disposed WebRequestTiming object for Android

When 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.

Version history
Last update:
‎02 Jan 2024 10:54 AM
Updated by: