Ads not working

So I have a two-part problem. A couple of days ago I was attempting to get my ads working as my game is in early access on the play store however no live ads were firing. I tried everything to get them to work with no luck so I thought maybe I should attempt to update the Unity Ads SDK from the asset store. I noticed that I appeared to have some of the files and others I did not so I choose to add all the missing files. Ever since that I am getting the follow three errors when I attempt to build.

If I remove the Unity Monitatizon SDK from my project and any mention of it from my scripts the game builds fine. Can anyone help?

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_171\bin\java.exe -classpath "H:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[
Note: there were 22 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 58s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
:preBuild UP-TO-DATE
:extractProguardFiles
:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:checkReleaseManifest
:GooglePlayGamesManifest.plugin:processReleaseManifest
:preReleaseBuild
:GooglePlayGamesManifest.plugin:compileReleaseAidl
:compileReleaseAidl
:GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar
:generateReleaseResValues
:generateReleaseResources
:GooglePlayGamesManifest.plugin:compileReleaseRenderscript
:GooglePlayGamesManifest.plugin:generateReleaseResValues
:GooglePlayGamesManifest.plugin:generateReleaseResources
:GooglePlayGamesManifest.plugin:packageReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
H:\Unity\Repos\Car Jumper\Temp\gradleOut\src\main\AndroidManifest.xml:24:9-31:50 Warning:
    activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present
:splitsDiscoveryTaskRelease
:GooglePlayGamesManifest.plugin:platformAttrExtractor
:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
:GooglePlayGamesManifest.plugin:prepareLintJar
:GooglePlayGamesManifest.plugin:javaPreCompileRelease
:GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
:compileReleaseNdk NO-SOURCE
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseShaders
:GooglePlayGamesManifest.plugin:compileReleaseShaders
:GooglePlayGamesManifest.plugin:generateReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseAssets
:mergeReleaseAssets
:processReleaseJavaRes NO-SOURCE
:GooglePlayGamesManifest.plugin:mergeReleaseConsumerProguardFiles
:mergeReleaseJniLibFolders
:GooglePlayGamesManifest.plugin:compileReleaseNdk NO-SOURCE
:GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders
:GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForRelease
:GooglePlayGamesManifest.plugin:transformNativeLibsWithIntermediateJniLibsForRelease
:validateSigningRelease
:GooglePlayGamesManifest.plugin:transformNativeLibsWithSyncJniLibsForRelease
:GooglePlayGamesManifest.plugin:mergeReleaseResources
:GooglePlayGamesManifest.plugin:verifyReleaseResources
:GooglePlayGamesManifest.plugin:processReleaseResources
:processReleaseResources
:generateReleaseSources
:GooglePlayGamesManifest.plugin:generateReleaseSources
:GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
:GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseSources
:lintVitalRelease
:transformResourcesWithMergeJavaResForRelease
:transformClassesAndResourcesWithProguardForRelease
ProGuard, version 5.3.3
Reading input...
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\android.arch.core.common-1.0.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\android.arch.lifecycle.common-1.0.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\com.android.support.support-annotations-26.1.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\unity-classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\android.arch.lifecycle.runtime-1.0.0.aar\a78ebae097dca4f63758e290afc6b88c\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.animated-vector-drawable-26.1.0.aar\2babc15a423ff9b97a41df42049c92af\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.appcompat-v7-26.1.0.aar\48a850870c7b34d53fd79a1836e2f246\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-compat-26.1.0.aar\1cf941e7e2550caf4ff1ec675d147671\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-core-ui-26.1.0.aar\e41269446b90d5445513a8ec3baa1126\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-core-utils-26.1.0.aar\0cfce77d47bd431e4140a9fb6e581e18\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-fragment-26.1.0.aar\34eef86ca90c2c16acfccbeed2c0de86\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-media-compat-26.1.0.aar\eb02d15bf100ff0fea09c64828f5a204\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-v4-26.1.0.aar\cd8086ef23cc4ec33a38ea2d893dedbf\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-vector-drawable-26.1.0.aar\a419e6d8685ea800531ef5f32ff63ebb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-ads-identifier-16.0.0.aar\bdaf2a24ef7dc88b93a7d9bf067813b5\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-appinvite-16.0.5.aar\4249c157271f05c430d6b28a4c6b6311\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-16.0.1.aar\de5fb1af940d89e75a53c36db3f0770e\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-api-phone-16.0.0.aar\ce11b95dde2fa2bb828b3012ac7b9547\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-base-16.0.0.aar\20136656a29b97b20d512ef33d6b3548\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-base-16.0.1.aar\1fd374d42921a60a91796b7f6dbe7918\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-basement-16.1.0.aar\55ad1acbfeb610b3a868514c1035abce\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-drive-16.0.0.aar\cc7d4e90ceee9dd68d542e8b56ed7cfb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-flags-16.0.1.aar\b8e92faa93e8eb8f60ac160d1520330b\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-games-16.0.0.aar\dcc4993efb08410a823054d566575735\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-measurement-api-16.0.3.aar\06c41266fc3a1cc94c5154decb0cb6dd\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-measurement-base-16.0.4.aar\4edbd47977023b767f2cb512d4eb706f\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-nearby-16.0.0.aar\970fcf6d34ae61ef54961b865d458fa0\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-stats-16.0.1.aar\69caca705ed015d3b954b3173283b9bc\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-tasks-16.0.1.aar\24412f8500a016694e4eacdd99cf75b2\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-analytics-16.0.5.aar\0e9ab1a22bbe24f8b4b7ed10d7454394\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-analytics-impl-16.2.3.aar\ab11c78d17b38288c1a6039a237ba276\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-app-unity-5.4.3.aar\c69c03ac3e0b8816c4b80059b6e044bb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-16.0.5.aar\92189d130dc68646d37ca0d920a60e93\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-interop-16.0.1.aar\2fc5d902018a7d4ca32f10925061f117\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-unity-5.4.3.aar\d34675192bf6a138aa32be0751ca8673\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-common-16.0.4.aar\2ea1afd5b8092eb2ac15e937a8f77e22\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-core-16.0.5.aar\ece9a8ea3e62268c3de3d0d610278a4a\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-dynamic-links-16.1.3.aar\653c8fe6ce0867726e3101af7cd73c84\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-dynamic-links-unity-5.4.3.aar\17633b75c436410dc949658a756520ef\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-iid-17.0.4.aar\4316450ecd86e32e2f4c4d8b9404e99c\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-iid-interop-16.0.1.aar\e71555b42cd4311da397003f01a41735\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-measurement-connector-17.0.1.aar\ca7f1d44da0ec359702be57189345353\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-measurement-connector-impl-17.0.3.aar\3e3931d2ddb6db10c809176fd0bf7555\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-messaging-17.3.4.aar\1be1a326ea34dfb452f79e71fbdf6b30\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-messaging-unity-5.4.3.aar\9102ffe5e0e029682d7a2500545f6395\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.games.gpgs-plugin-support-0.9.56.aar\64584c98d068c870bf1604b3a3825c80\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.sglib.easymobile.easy-mobile-1.1.0.aar\46fde4d6955b93e9138588ddd6241db7\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\unity-ads.aar\ea20e9a8f7c574c1f21313559c5e12a7\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\UnityAds.aar\140bc812f59ef12b1c35cfe4165e97b2\jars\classes.jar] (filtered)
Note: duplicate definition of program class [com.unity3d.ads.BuildConfig]
Note: duplicate definition of program class [com.unity3d.ads.IUnityAdsListener]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$FinishState]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$PlacementState]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$UnityAdsError]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds]
Note: duplicate definition of program class [com.unity3d.ads.mediation.IUnityAdsExtendedListener]
Note: duplicate definition of program class [com.unity3d.ads.metadata.InAppPurchaseMetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.MediationMetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.MetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.PlayerMetaData]
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\GooglePlayGamesManifest.plugin\build\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program directory [H:\Unity\Repos\Car Jumper\Temp\gradleOut\build\intermediates\classes\release] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\build\intermediates\transforms\mergeJavaRes\release\0.jar] (filtered)
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\android.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [android.net.http.HttpResponseCache]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.mock.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.base.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.runner.jar]
Initializing...
Note: the configuration refers to the unknown class 'com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian'
Note: the configuration refers to the unknown class 'com.google.android.gms.crash.internal.api.CrashApiImpl'
Note: the configuration refers to the unk<message truncated>
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Here is the full first error it was cut off for some reason.

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_171\bin\java.exe -classpath "H:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[
Note: there were 22 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 58s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
:preBuild UP-TO-DATE
:extractProguardFiles
:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:checkReleaseManifest
:GooglePlayGamesManifest.plugin:processReleaseManifest
:preReleaseBuild
:GooglePlayGamesManifest.plugin:compileReleaseAidl
:compileReleaseAidl
:GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar
:generateReleaseResValues
:generateReleaseResources
:GooglePlayGamesManifest.plugin:compileReleaseRenderscript
:GooglePlayGamesManifest.plugin:generateReleaseResValues
:GooglePlayGamesManifest.plugin:generateReleaseResources
:GooglePlayGamesManifest.plugin:packageReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
H:\Unity\Repos\Car Jumper\Temp\gradleOut\src\main\AndroidManifest.xml:24:9-31:50 Warning:
    activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present
:splitsDiscoveryTaskRelease
:GooglePlayGamesManifest.plugin:platformAttrExtractor
:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
:GooglePlayGamesManifest.plugin:prepareLintJar
:GooglePlayGamesManifest.plugin:javaPreCompileRelease
:GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
:compileReleaseNdk NO-SOURCE
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseShaders
:GooglePlayGamesManifest.plugin:compileReleaseShaders
:GooglePlayGamesManifest.plugin:generateReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseAssets
:mergeReleaseAssets
:processReleaseJavaRes NO-SOURCE
:GooglePlayGamesManifest.plugin:mergeReleaseConsumerProguardFiles
:mergeReleaseJniLibFolders
:GooglePlayGamesManifest.plugin:compileReleaseNdk NO-SOURCE
:GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders
:GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForRelease
:GooglePlayGamesManifest.plugin:transformNativeLibsWithIntermediateJniLibsForRelease
:validateSigningRelease
:GooglePlayGamesManifest.plugin:transformNativeLibsWithSyncJniLibsForRelease
:GooglePlayGamesManifest.plugin:mergeReleaseResources
:GooglePlayGamesManifest.plugin:verifyReleaseResources
:GooglePlayGamesManifest.plugin:processReleaseResources
:processReleaseResources
:generateReleaseSources
:GooglePlayGamesManifest.plugin:generateReleaseSources
:GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
:GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseSources
:lintVitalRelease
:transformResourcesWithMergeJavaResForRelease
:transformClassesAndResourcesWithProguardForRelease
ProGuard, version 5.3.3
Reading input...
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\android.arch.core.common-1.0.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\android.arch.lifecycle.common-1.0.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\com.android.support.support-annotations-26.1.0.jar] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\libs\unity-classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\android.arch.lifecycle.runtime-1.0.0.aar\a78ebae097dca4f63758e290afc6b88c\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.animated-vector-drawable-26.1.0.aar\2babc15a423ff9b97a41df42049c92af\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.appcompat-v7-26.1.0.aar\48a850870c7b34d53fd79a1836e2f246\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-compat-26.1.0.aar\1cf941e7e2550caf4ff1ec675d147671\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-core-ui-26.1.0.aar\e41269446b90d5445513a8ec3baa1126\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-core-utils-26.1.0.aar\0cfce77d47bd431e4140a9fb6e581e18\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-fragment-26.1.0.aar\34eef86ca90c2c16acfccbeed2c0de86\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-media-compat-26.1.0.aar\eb02d15bf100ff0fea09c64828f5a204\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-v4-26.1.0.aar\cd8086ef23cc4ec33a38ea2d893dedbf\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.android.support.support-vector-drawable-26.1.0.aar\a419e6d8685ea800531ef5f32ff63ebb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-ads-identifier-16.0.0.aar\bdaf2a24ef7dc88b93a7d9bf067813b5\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-appinvite-16.0.5.aar\4249c157271f05c430d6b28a4c6b6311\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-16.0.1.aar\de5fb1af940d89e75a53c36db3f0770e\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-api-phone-16.0.0.aar\ce11b95dde2fa2bb828b3012ac7b9547\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-auth-base-16.0.0.aar\20136656a29b97b20d512ef33d6b3548\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-base-16.0.1.aar\1fd374d42921a60a91796b7f6dbe7918\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-basement-16.1.0.aar\55ad1acbfeb610b3a868514c1035abce\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-drive-16.0.0.aar\cc7d4e90ceee9dd68d542e8b56ed7cfb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-flags-16.0.1.aar\b8e92faa93e8eb8f60ac160d1520330b\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-games-16.0.0.aar\dcc4993efb08410a823054d566575735\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-measurement-api-16.0.3.aar\06c41266fc3a1cc94c5154decb0cb6dd\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-measurement-base-16.0.4.aar\4edbd47977023b767f2cb512d4eb706f\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-nearby-16.0.0.aar\970fcf6d34ae61ef54961b865d458fa0\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-stats-16.0.1.aar\69caca705ed015d3b954b3173283b9bc\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.android.gms.play-services-tasks-16.0.1.aar\24412f8500a016694e4eacdd99cf75b2\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-analytics-16.0.5.aar\0e9ab1a22bbe24f8b4b7ed10d7454394\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-analytics-impl-16.2.3.aar\ab11c78d17b38288c1a6039a237ba276\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-app-unity-5.4.3.aar\c69c03ac3e0b8816c4b80059b6e044bb\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-16.0.5.aar\92189d130dc68646d37ca0d920a60e93\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-interop-16.0.1.aar\2fc5d902018a7d4ca32f10925061f117\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-auth-unity-5.4.3.aar\d34675192bf6a138aa32be0751ca8673\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-common-16.0.4.aar\2ea1afd5b8092eb2ac15e937a8f77e22\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-core-16.0.5.aar\ece9a8ea3e62268c3de3d0d610278a4a\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-dynamic-links-16.1.3.aar\653c8fe6ce0867726e3101af7cd73c84\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-dynamic-links-unity-5.4.3.aar\17633b75c436410dc949658a756520ef\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-iid-17.0.4.aar\4316450ecd86e32e2f4c4d8b9404e99c\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-iid-interop-16.0.1.aar\e71555b42cd4311da397003f01a41735\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-measurement-connector-17.0.1.aar\ca7f1d44da0ec359702be57189345353\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-measurement-connector-impl-17.0.3.aar\3e3931d2ddb6db10c809176fd0bf7555\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-messaging-17.3.4.aar\1be1a326ea34dfb452f79e71fbdf6b30\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.firebase.firebase-messaging-unity-5.4.3.aar\9102ffe5e0e029682d7a2500545f6395\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.google.games.gpgs-plugin-support-0.9.56.aar\64584c98d068c870bf1604b3a3825c80\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\com.sglib.easymobile.easy-mobile-1.1.0.aar\46fde4d6955b93e9138588ddd6241db7\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\unity-ads.aar\ea20e9a8f7c574c1f21313559c5e12a7\jars\classes.jar] (filtered)
Reading program jar [C:\Users\Benjaman Harre\.gradle\caches\transforms-1\files-1.1\UnityAds.aar\140bc812f59ef12b1c35cfe4165e97b2\jars\classes.jar] (filtered)
Note: duplicate definition of program class [com.unity3d.ads.BuildConfig]
Note: duplicate definition of program class [com.unity3d.ads.IUnityAdsListener]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$FinishState]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$PlacementState]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds$UnityAdsError]
Note: duplicate definition of program class [com.unity3d.ads.UnityAds]
Note: duplicate definition of program class [com.unity3d.ads.mediation.IUnityAdsExtendedListener]
Note: duplicate definition of program class [com.unity3d.ads.metadata.InAppPurchaseMetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.MediationMetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.MetaData]
Note: duplicate definition of program class [com.unity3d.ads.metadata.PlayerMetaData]
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\GooglePlayGamesManifest.plugin\build\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program directory [H:\Unity\Repos\Car Jumper\Temp\gradleOut\build\intermediates\classes\release] (filtered)
Reading program jar [H:\Unity\Repos\Car Jumper\Temp\gradleOut\build\intermediates\transforms\mergeJavaRes\release\0.jar] (filtered)
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\android.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [android.net.http.HttpResponseCache]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.mock.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.base.jar]
Reading library jar [C:\Users\Benjaman Harre\AppData\Local\Android\Sdk\platforms\android-28\optional\android.test.runner.jar]
Initializing...
Note: the configuration refers to the unknown class 'com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian'
Note: the configuration refers to the unknown class 'com.google.android.gms.crash.internal.api.CrashApiImpl'
Note: the configuration refers to the unk<message truncated>

UPDATE: By removing UnityAds.aar I was able to get the game to build without errors. However I am still having issues with getting the ads to display.

In the editor I get the dummy add that says its working but on device nothing happens.

Here is the code.

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Monetization;

public class UnityAdManager : MonoBehaviour
{
    public static UnityAdManager Instance { get; set; }

    public Button coins, rubies, upgrade, powerup;
    public Text coolDown;

    private DateTime currentDate, oldDate;
    private TimeSpan timeAway, difference;
    private bool countDown;

#if UNITY_IOS
    private string gameId = "iPhone ID";
#elif UNITY_ANDROID
    private string gameId = "Android ID";
#endif

    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this);
        Instance = this;
        //Monetization.Initialize(gameId, false);

        Debug.Log("DATETIME: " + PlayerPrefs.GetString("videoRewards"));
        CheckTime();
        CheckUnlock();
    }

    void Update()
    {
        CheckTime();

        if (countDown)
        {
            CountDown();
        }
    }

    public void ShowAd(string type)
    {
        StartCoroutine(WaitForAd(type));
    }

    IEnumerator WaitForAd(string type)
    {
        while (!Monetization.IsReady(type))
        {
            yield return null;
        }

        ShowAdPlacementContent ad = null;
        ad = Monetization.GetPlacementContent(type) as ShowAdPlacementContent;

        if (ad != null)
        {
            if (type == "video")
            {
                ad.Show(AdFinished);
            }
            else if (type == "rewardedVideo")
            {
                ad.Show(AdFinished);
            }
            else if (type == "unlock1")
            {
                ad.Show(AdFinished01);
            }
            else if (type == "unlock2")
            {
                ad.Show(AdFinished02);
            }
            else if (type == "unlock3")
            {
                ad.Show(AdFinished03);
            }
            else if (type == "unlock4")
            {
                ad.Show(AdFinished04);
            }
            else
            {
                ad.Show(AdFinished);
            }
        }
    }

    void AdFinished(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            // Reward the player
        }
    }

    void AdFinished01(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            Player.GiveCoins(1000);
            SetDateTime();
            UnlockButton(coins, rubies);
            PlayerPrefs.SetString("CoinButton", "Locked");
        }
    }

    void AdFinished02(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            Player.GiveRubies(5);
            UnlockButton(rubies, upgrade);
            PlayerPrefs.SetString("RubiesButton", "Locked");
        }
    }

    void AdFinished03(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            Player.AddHydros(1);
            UnlockButton(upgrade, powerup);
        }
    }

    void AdFinished04(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            Player.AddNitros(1);
            UnlockButton(powerup, null);
        }
    }

    private void CheckTime()
    {
        //Store the current time when it starts
        currentDate = System.DateTime.Now;

        //Grab the old time from the player prefs as a long
        long temp = Convert.ToInt64(PlayerPrefs.GetString("videoRewards"));
        oldDate = DateTime.FromBinary(temp);

        //Use the Subtract method and store the result as a timespan variable
        difference = currentDate.Subtract(oldDate);
        timeAway = difference;
    }

    private void SetDateTime()
    {
        PlayerPrefs.SetString("videoRewards", DateTime.Now.ToBinary().ToString());
    }

    private void CheckUnlock()
    {
        if (timeAway >= TimeSpan.FromHours(24))
        {
            countDown = false;
            UnlockButtons();
            coolDown.text = "Your daily rewards are ready to be claimed!";
        }
        else
        {
            countDown = true;

            if (PlayerPrefs.GetString("CoinButton") == "Locked")
            {
                coins.interactable = false;
            }
            else
            {
                coins.interactable = true;
            }

            if (PlayerPrefs.GetString("RubiesButton") == "Locked")
            {
                rubies.interactable = false;
            }
            else
            {
                rubies.interactable = true;
            }

            if (PlayerPrefs.GetString("UpgradeButton") == "Locked")
            {
                upgrade.interactable = false;
            }
            else
            {
                upgrade.interactable = true;
            }

            if (PlayerPrefs.GetString("PowerupButton") == "Locked")
            {
                powerup.interactable = false;
            }
            else
            {
                powerup.interactable = true;
            }
        }
    }

    private void CountDown()
    {
        TimeSpan remaining = TimeSpan.FromHours(24) - timeAway;
        string hours = string.Format("{0}", remaining.Hours);
        string mins = string.Format("{0}", remaining.Minutes);
        string secs = string.Format("{0}", remaining.Seconds);

        if (remaining.Hours > 0)
        {
            if (coolDown != null)
                coolDown.text = "Daily Rewards Unlock in " + hours + " hours, " + mins + " minutes, and " + secs + " seconds!";
        }
        else if (remaining.Minutes > 0)
        {
            if (coolDown != null)
                coolDown.text = "Daily Rewards Unlock in " + mins + " minutes, and " + secs + " seconds!";
        }
        else
        {
            if (coolDown != null)
                coolDown.text = "Daily Rewards Unlock in " + secs + " seconds!";
        }
    }

    private void UnlockButtons()
    {
        coins.interactable = true;
        rubies.interactable = false;
        upgrade.interactable = false;
        powerup.interactable = false;

        PlayerPrefs.SetString("CoinButton", "Unlocked");
        PlayerPrefs.SetString("RubiesButton", "Unlocked");
        PlayerPrefs.SetString("UpgradeButton", "Unlocked");
        PlayerPrefs.SetString("PowerupButton", "Unlocked");
    }

    public void UnlockButton(Button cbtn, Button nbtn)
    {
        Debug.Log("UnlockButton Called");
        Debug.Log(cbtn);
        Debug.Log(nbtn);

        if (cbtn != null)
            cbtn.interactable = false;

        if (nbtn != null)
            nbtn.interactable = true;
    }
}

I would like to bump this because I am having the same issue on 2018.3. On Android I am having an issue with Monetization.Initialize() it seems. Using Unity Monetization 3.0. The game will load, but as soon as the script runs, the game will crash while Monetizatin.Initialize() is running, generally after a second of the script being invoked.

Editor works just fine and displays the proper test ad.

1 Like

[quote=“ivieslinda”, post:5, topic: 726953]
I would like to bump this because I am having the same issue on 2018.3. On Android I am having an issue with Monetization.Initialize() it seems. Using Unity Monetization 3.0. The game will load, but as soon as the script runs, the game will crash while Monetizatin.Initialize() is running, generally after a second of the script being invoked.

Editor works just fine and displays the proper test ad.
[/quote]

I have exactly the same problem on unity2018.3.0! When building a project on an android, during the initialization the game stops responding. Commenting on the line with initialization solves the problem.

[quote=“ivieslinda”, post:5, topic: 726953]
I would like to bump this because I am having the same issue on 2018.3. On Android I am having an issue with Monetization.Initialize() it seems. Using Unity Monetization 3.0. The game will load, but as soon as the script runs, the game will crash while Monetizatin.Initialize() is running, generally after a second of the script being invoked.

Editor works just fine and displays the proper test ad.
[/quote]

I was able to solve the problem: I was helped by turning off Unity Ads in the services window and turning on Unity Analytics:) And check in manifest that unity ads are completely removed from your project. You should have only Unity Monetization package in the project

Thanks! That worked for me too!

Summary:

Don't follow Unity's instructions, which are completely wrong.
Disable Ads Under services (but leave Analytics)
Remove Advertisement from Windows->Package Manager
Install 'Unity Monetization 3.0' from the asset store (5th one when searching 'Monetization', non existent when searching 'ads')

1 Like