admob - AdView not recognized in Android Studio -
i trying integrate admob in app, android studio can't find libraries:
import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview;
this top-level gradle:
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' classpath 'com.google.gms:google-services:3.0.0' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } }
and project-level gradle:
apply plugin: 'com.android.application' android { compilesdkversion 24 buildtoolsversion "24.0.1" defaultconfig { applicationid "com.tomhogenkamp.personalcalc" minsdkversion 16 targetsdkversion 24 versioncode 4 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:24.1.1' compile 'com.google.firebase:firebase-core:9.4.0' compile 'com.github.yukuku:ambilwarna:2.0.1' } apply plugin: 'com.google.gms.google-services'
i have added admob in more apps, had no troubles this.
can me?
thanks!
it looks you're missing dependency ads. build.gradle:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:24.1.1' compile 'com.google.firebase:firebase-core:9.4.0' compile 'com.github.yukuku:ambilwarna:2.0.1' }
should have additional line:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:24.1.1' compile 'com.google.firebase:firebase-core:9.4.0' compile 'com.google.firebase:firebase-ads:9.4.0' compile 'com.github.yukuku:ambilwarna:2.0.1' }
for more info, wrote blog post ways import mobile ads sdk firebase. there's episode of mobile ads garage covers this.
Comments
Post a Comment