Integrate interstitial ad in my app

go6o78

New member
Sep 4, 2017
0
0
0
Visit site
Hello
i am not a coder but i want to insert
interstitial ad code in my project - live wallpaper made with livepaper creator, how i said i'm not a coder
i put this in my build.gradle file, but sync failed

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile 'com.google.android.gms:play-services-ads:11.2.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-ads:9.6.1'
testCompile 'junit:junit:4.12'

}

allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}

}
Code:
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}
 
apply plugin: 'com.android.application'
android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
         minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
 
dependencies {
                compile 'com.google.android.gms:play-services-ads:11.2.0'
        compile fileTree(dir: 'libs', include: ['*.jar'])
              compile 'com.android.support:appcompat-v7:25.3.1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.google.android.gms:play-services-ads:9.6.1'
        testCompile 'junit:junit:4.12'
 
    }
 
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
 
    }

Error:eek:rg.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

and i cant move on  :) can somebody help me with this integrate
i try to integrate interstitial ad from ADMOB
here is link to my source files
https://drive.google.com/open?id=0B2u6yCWB2rETeWFrM0pESUF2NUE
 

Forum statistics

Threads
943,146
Messages
6,917,514
Members
3,158,845
Latest member
educationalco22