I'm trying to implement ads in my app, and eventually in-app purchases (to register a full version upgrade from free)
I've been following the tutorial from this site
I've created my AdMob Account, and added my app, I have the adUnitID, and from what I can tell that part is completed properly.
The problem I am having is when I try to compile the code, I get missing AndroidX assemblies,
Here is the specific error I am getting
Could not find 8 Android X assemblies, make sure to install the following NuGet packages: - Xamarin.AndroidX.Lifecycle.LiveData - Xamarin.Google.Android.Material - Xamarin.AndroidX.Legacy.Support.V4
(Please note it says 8 but only lists 3 assemblies)
I've tried installing those assemblies. Once they are installed I get two errors when I try to build.
1>C:\Users\jesse\OneDrive\Documents\Source\...\obj\Debug\90\lp\124\jl\res\values\values.xml(1778): error APT2000: expected enum but got (raw string) slide.
Which is this line in the code
And the other error is
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Aapt2.targets(164,3): error APT2062: failed linking references.
This is the linking reference it refers to.
<Aapt2Link Condition=" '$(_AndroidResourceDesignerFile)' != '' And '$(_AndroidUseAapt2)' == 'True' " ContinueOnError="$(DesignTimeBuild)" DaemonMaxInstanceCount="$(Aapt2DaemonMaxInstanceCount)" DaemonKeepInDomain="$(_Aapt2DaemonKeepInDomain)" ResourceNameCaseMap="$(_AndroidResourceNameCaseMap)" AssemblyIdentityMapFile="$(_AndroidLibrayProjectAssemblyMapFile)" ImportsDirectory="$(_LibraryProjectImportsDirectoryName)" UseShortFileNames="$(UseShortFileNames)" OutputImportDirectory="$(_AndroidLibrayProjectIntermediatePath)" OutputFile="$(ResgenTemporaryDirectory)\resources.apk" PackageName="$(_AndroidPackage)" ApplicationName="$(_AndroidPackage)" JavaPlatformJarPath="$(JavaPlatformJarPath)" JavaDesignerOutputDirectory="$(ResgenTemporaryDirectory)" CompiledResourceFlatFiles="@(_CompiledFlatFiles)" ManifestFiles="$(ResgenTemporaryDirectory)\AndroidManifest.xml" AdditionalAndroidResourcePaths="@(_LibraryResourceDirectories)" YieldDuringToolExecution="$(YieldDuringToolExecution)" ResourceSymbolsTextFile="$(IntermediateOutputPath)R.txt" ResourceDirectories="$(MonoAndroidResDirIntermediate)" ExtraArgs="$(AndroidAapt2LinkExtraArgs)" ToolPath="$(Aapt2ToolPath)" ToolExe="$(Aapt2ToolExe)" UncompressedFileExtensions="$(AndroidStoreUncompressedFileExtensions)" ProguardRuleOutput="$(_Aapt2ProguardRules)" />
If I change the SDK version to Android10, all of the errors go away, the package gets deployed, but will not show up in the app launcher, and will not start when I try to debug it.
I'm terrified at what it's going to be like to add the in app purchase for my app... (actually just considering making a separate app in the store and making a new build target / alternate code base to build it from)
Please, there has to be some way to implement ads in a Xamarin.Forms app, that supports Android 9...
Anyone who's implemented AdMob to a Xamarin.Forms app (I don't even care if it supports iOS for now. I would be nice for the future, but for now I just want to get my Android app up and running)