So im following this tutorial... https://firebase.google.com/docs/admob/android/quick-start?hl=en-US
Im trying to get AdMob on my Android app but when i get to the section where i am adding the plugin to my project i get this error message:
Error:(9, 0) Plugin with id 'com.google.gms.google-services' not found.
Open File
Im adding it to the app level build.gradle. Below is the build.grade file.
Can anyone see what the problem could be??
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.muggysoft.datrxsync"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
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.2.1'
compile 'com.google.firebase:firebase-ads:10.0.0'
}
apply plugin: 'com.google.gms.google-services'
you first need to Add Firebase to Your Android Project
follow this guide and hopefully your problem will be solved
You are missing this dependency in your root-level (project) build.gradle file:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
Related
I have two modules in my project:
app
app_list
Both modules have java and res. app_list has some activities that I want to launch in app.
In Eclipse, I had app_list as dependency library and I was able to launch activity of app_list. In Android Studio, when I added app_list as dependency, it says:
"Error:A problem occurred configuring project ':app'.
> Dependency NewMathBuzz:app_list:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: <home>/NewMathBuzz/app_list/build/outputs/apk/app_list-release-unsigned.apk
"
app > build.gradle is as below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.mass.mathbuzz"
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':app_list')
compile fileTree(dir: 'libs', include: ['*.jar'])
}
app_list > build.gradle is as below:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.android.support:appcompat-v7:22.0.0'
}
Could someone help me with this?
Everything was fine,
basically when I changed app_list.gradle as
apply plugin: 'com.android.application' to apply plugin: 'com.android.library' and deleted applicationId from app_list.gradle
it compiled and generated apk but I was getting runtime error that was because both app and app_list both had same resource main_activity so R.java didn't have main_activity res of app_list so it was giving illegal_parameter error . When I changed name of main_activity to some unique name it solved the issue
I'm facing this issue when trying to run a project originally made on Eclipse ADT.
Error:(17, 0) Gradle DSL method not found: 'compileSdkVersion()'
Possible causes:<ul><li>The project 'TaxiAndroidOpen-master' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>
I already converted this to Android Studio gradle system.
But I cannot run it, nor compile it, because of this error, here's the gradle generated:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
ext {
compileSdkVersion 17
buildToolsVersion '18.1.0'
}
dependencies {
}
I've found some other posts here on SO, with similar errors, but no one has this specific one.
I'm using Android Studio 1.0.2, x86.
Anybody can shed some light on this?
Thanks in advance!
EDIT
Updated build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.opentaxi.android"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':comtaxibulgariamap_mapsforge_044201406271417533')
compile files('libs/littlefluffylocationlibrary_r15.jar')
}
Your application module's build.gradle file should look like this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.opentaxi.android"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':comtaxibulgariamap_mapsforge_044201406271417533')
compile fileTree(include: ['*.jar'], dir: 'libs')
}
And remove these lines from your main build.gradle (in application's root) if it exists as you posted.
ext {
compileSdkVersion 17
buildToolsVersion '18.1.0'
}
dependencies {
}
Did you recently upgrade to Android Studio 1.0? If so, replace runProguard with minifyEnabled in your app/build.gradle.
worked for me after I added, in build.gradle (Module):
apply plugin: 'kotlin-kapt'
Can also get this error if one puts implementation file in the wrong gradle.
Should be put inside build.graddle (module) here
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
rather than in build.graddle(App)
I want to use RecyclerViewLib in my project and for that I downloaded it and imported it as a module to my empty "hello world" Android project. I am using android studio v1.0.1 using sdk manager v24 and this is my app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.mk.dragdrop4"
minSdkVersion 14
targetSdkVersion 17
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
and this is my library/build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 17
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:support-v4:20.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
apply from: 'https://raw.github.com/twotoasters/gradle-mvn-push/master/gradle-mvn-push.gradle'
But when I import that I'm getting this error message:
Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
Can anyone help me about this problem?
Remove this line from the build.gradle on the specified project
apply from: 'https://raw.github.com/twotoasters/gradle-mvn-push/master/gradle-mvn-push.gradle'
I have experienced a very similar problem.
I tried to include the QuickReturn feature into my app : https://github.com/felipecsl/QuickReturn
I'm using Android Studios 1.0 and after I imported the library into my project, it gives me the same error. I then looked at the build.gradle file for the library and removed this line and it worked:
apply from: 'gradle-mvn-push.gradle'
Similar issue.
Removed line:
apply from: 'maven-push.gradle'
from build.gradle and was able to sync successfully.
check library and project build.gradle and comment this line if you found
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3' // include latest gradle version and if project build with older version can update or can user same version
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
The error I am getting is:
Gradle 'MyProject' project refresh failed:
Project with path 'libraries:mylibrary_sdk' could not be found in project':myproject'
This is my settings gradle
include ':libraries:mylibrary_sdk',':myproject'
Top level build gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
myproject build gradle
apply plugin: 'android'
dependencies {
compile 'com.android.support:support-v4:19.0.1'
compile project ("libraries:mylibrary_sdk")
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
mylibrary_sdk build gradle
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
I have read over all the similar answers but I am still stuck on this issue. If I remove compile project ("libraries:mylibrary_sdk") and the libraries:mylibrary_sdk include then myproject builds fine, just without access to mylibrary. The libraries folder is at the same level as settings.gradle, the top level build.gradle and the folder with myproject.
Any help would be appreciated.
This works, adding in answer..it might help someone later
dependencies { compile 'com.android.support:support-v4:19.0.1' compile project (":libraries:mylibrary_sdk") }
Below is code from my build.gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
}
When I do Sync project with gradle files, it gives me error.
Error:(28, 13) Failed to resolve: com.facebook.android:facebook-android-sdk:4.4.0
Can anyone tell me why I'm getting this error?
Similar question has been asked here but no one has answered it. (
Failed to resolve: com.facebook.android:facebook-android-sdk:4.0.0 )
Finally after spending 6-8 hours on it. I got the solution for you. You have to just change repositories section in your app build.gradle file. change it from mavenCentral to jcenter as following
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
After having this, You can simply add the dependency as
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
Try This,
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.4.1'
}
Information
buildToolsVersion "23.0.0 rc3" is not stable purely .Set minSdkVersion 15