Home > Enterprise >  Xamarin FireBase Analytics monoandroid 12
Xamarin FireBase Analytics monoandroid 12

Time:01-24

Hi I am trying to add Xamarin.Firebase.Analytics to my Xamarin Forms app. getting the error below.

My Xamarin.Android AndroidManifest.Xaml is already set to android:targetSdkVersion="33". What else needs to be corrected for this to work?

Xamarin Forms version is: 5.0.0.2545

Package Xamarin.Firebase.Analytics.Impl 116.3.0.7 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.Firebase.Analytics.Impl 116.3.0.7 supports:
  - monoandroid12.0 (MonoAndroid,Version=v12.0)

This is the visual studio info

Visual Studio Community 2022 for Mac
Version 17.4.3 (build 21)

Runtime
.NET 6.0.12 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.4.0-6.22578.12 3c6ab8e1715e5b080fb7bb77070810ab71e09387

NuGet
Version: 6.3.1.1

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/7.0.102/Sdks
SDK Versions:
    7.0.102
    7.0.101
    6.0.405
    6.0.404
    6.0.402
    6.0.302
    6.0.301
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Versions:
    6.0.405
    6.0.404
    6.0.402
    6.0.302
    6.0.106
    6.0.104
    5.0.408
    5.0.407
    3.1.426
    3.1.424
    3.1.421
    3.1.420
    3.1.418

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    7.0.2
    7.0.1
    6.0.13
    6.0.12
    6.0.10
    6.0.7
    6.0.6

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
    6.0.13
    6.0.12
    6.0.10
    6.0.7
    6.0.6
    6.0.4
    5.0.17
    5.0.16
    3.1.32
    3.1.30
    3.1.27
    3.1.26
    3.1.24

Xamarin Designer
Version: 17.4.0.136
Hash: d49c9ff6d3
Branch: remotes/origin/d17-4
Build date: 2023-01-12 17:32:30 UTC

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode 14.2 (21534)
Build 14C18


Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS
Version: 16.1.1.27 (Visual Studio Community)
Hash: 933c6c2c9
Branch: xcode14.1
Build date: 2022-11-22 02:00:37-0500

Xamarin.Android
Version: 13.1.0.1 (Visual Studio Community)
Commit: xamarin-android/d17-4/13ba222
Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        8.0  (API level 26)
        6.0  (API level 23)
        12.0 (API level 31)
        8.1  (API level 27)
        11.0 (API level 30)
        10.0 (API level 29)
        7.1  (API level 25)
        9.0  (API level 28)
        13.0 (API level 33)

CodePudding user response:

I have created a project and reproduced your problem. The Xamarin.Firebase.Analytics package only support the android. And the Xamarin.Forms is cross-platform.

So you should only add this package in the project's Android Part, not the pcl. I reproduce the error message when I tried to add it in the pcl. But the project built successfully when I only added it in the android part.

Just right click your project.Android part -> select manage nuget packages -> insatll this package.

CodePudding user response:

Figured it out, need to edit the Android.csproj file.

Replace

   <TargetFrameworkVersion>v11.0</TargetFrameworkVersion>

with

   <TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
  • Related