Unity Google Ads Plugin
Unity Google Ads Plugin
https://github.com/googleads/googleads-mobile-unity
Step1:
I solve this roblem by setting JAVA_HOME as C:\Program Files\Java\jdk1.8.0_05 in environment variable
And then click "Resolve Client Jars" and rebuild.
Step2: change the google sdk minimum version as 19.1.0,remember use SDK Manager download build tools.
svcSupport.DependOn("com.android.support", "appcompat-v7", "19.1.0+");
public static class AdMobDependencies
{
/// The name of the plugin.
private static readonly string PluginName = "AdMobUnity";
/// Initializes static members of the class.
static AdMobDependencies()
{
PlayServicesSupport svcSupport =
PlayServicesSupport.CreateInstance(PluginName, EditorPrefs.GetString("AndroidSdkRoot"),
"ProjectSettings");
svcSupport.DependOn("com.google.android.gms", "play-services-ads", "LATEST");
// Marshmallow permissions requires app-compat.
//svcSupport.DependOn("com.android.support", "appcompat-v7", "23.1.0+");
svcSupport.DependOn("com.android.support", "appcompat-v7", "19.1.0+");
}
Step3: change unity player google sdk version as 4.1(19)
Step4:
Assets->Google Play services->Resolve Client Jars within the Unity editor. Posting the full contents of the error message you're running into would also help in investigating what's happening.
Step5:rebuild apk