Can't get AdMob Plugin Pro to work with Cordova in Visual Studio 2017 for my Android app

廉价感情. 提交于 2020-01-25 08:22:08

问题


I'm having a lot of trouble getting this to work, and there doesn't seem to be much here using VS. The current build error is:

   Attribute application@appComponentFactory value= 
   (androidx.core.app.CoreComponentFactory) from 
   [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
   is also present at 
   [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 
   value=(android.support.v4.app.CoreComponentFactory).

I've tried everything suggested here, including creating a gradle.properties file containing:

 android.useAndroidX=true
 android.enableJetifier=true

(Also I'm confused about where that file should go in VS, and I think I'm editing the right AndroidManifest file...)

Here's my AndroidManifest file:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true"  android:versionName="1.1.0" package="uk.xx.xx" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="schemas.android.com/tools">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" android:theme="@android:style/Theme.Translucent" />
        <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-4177600634055046~8086469850" />
    </application>
    <uses-sdk android:maxSdkVersion="28" android:minSdkVersion="19" android:targetSdkVersion="28" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

Could it be conflicts between different versions of the various libraries? I'm using

VS Community 2017
Cordova 6.3.1
cordova-android 5.2.1
Android target API level 28
AdMob Plugin Pro 2.49.0
PLAY_SERVICES_VERSION 18.2.0
Google Mobile Ads SDK for Cordova 7.49.0

Has anybody got this to work? If so are your versions different to mine? Thanks

来源:https://stackoverflow.com/questions/58643547/cant-get-admob-plugin-pro-to-work-with-cordova-in-visual-studio-2017-for-my-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!