Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am trying to integrate AdMob into my android application but its not working out for me, I have added the bellow maven directive to my all project section:
maven {
            url "https://maven.google.com"
        }

I have added the bellow dependency to the dependency section:
implementation 'com.google.android.gms:play-services-ads:16.0.0'


And that was the beginning of my problem, its throwing two errors, it underlined in red
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'

error saying
all com.android.support libraries must use the exact same version specification

and
implementation 'com.google.android.gms:play-services-ads:16.0.0'

error saying
all gms/firebase libraries must use the exact same version specification

Please I need help...

What I have tried:

Manifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gns.projecttopicsfinder">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="Project Topics Finder"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.example.gns.projecttopicsfinder.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


<activity android:name="com.example.gns.projecttopicsfinder.CompSc" />
<activity android:name="com.example.gns.projecttopicsfinder.CompEng" />
<activity android:name="com.example.gns.projecttopicsfinder.MassComm" />
<activity android:name="com.example.gns.projecttopicsfinder.Civil" />
<activity android:name="com.example.gns.projecttopicsfinder.Mechanical" />
<activity android:name="com.example.gns.projecttopicsfinder.PublicAdmin" />
<activity android:name="com.example.gns.projecttopicsfinder.Psychology" />
<activity android:name="com.example.gns.projecttopicsfinder.Soil" />
<activity android:name="com.example.gns.projecttopicsfinder.Sociology" />
<activity android:name="com.example.gns.projecttopicsfinder.Banking">





All Project Section

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

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


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

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

task clean(type: Delete) {
delete rootProject.buildDir
}



Dependencies


apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.gns.projecttopicsfinder"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900