Gradle apply plugin: com.google.gms.google-services - android

When I'm trying to put apply plugin: 'com.google.gms.google-services' at the bottom of my build gradle or anywhere else inside my apps build gradle I get a error say it can't find it.
Error:(70, 0) Plugin with id 'com.google.gms.google-services' not found.
Here's my gradle code so you guy's can help me figure out where to place it.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
applicationId "com.technologx.blaze.player"
minSdkVersion 16
targetSdkVersion 24
versionCode 101
versionName "1.0 beta 1"
//renderscript support mode is not supported for 21+ with gradle version 2.0
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
ext.enableCrashlytics = false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:palette-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:percent:24.2.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'net.steamcrafted:materialiconlib:1.0.3'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.google.code.gson:gson:2.3'
compile 'de.Maxr1998:track-selector-lib:1.1'
compile 'com.afollestad.material-dialogs:core:0.9.0.2'
compile 'com.afollestad.material-dialogs:commons:0.9.0.2'
compile 'com.anjlab.android.iab.v3:library:1.0.+'
compile('com.github.naman14:app-theme-engine:0.5.2#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'

I think you also need this in your projects gradle file:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}

Related

debug app build failure after enabling proguard

Error:Execution failed for task
':app:transformClassesWithAndroidGradleClassShrinkerForDebug'.
Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.
How do i fix this?
PS- also I want to use progaurd in my application.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
dexOptions{
javaMaxHeapSize="2g"
}
defaultConfig {
applicationId "com.example.projetinnovation.newadvocatediary"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled=true
}
buildTypes {
debug {
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-andr oid.txt'),
'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android. txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
google()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':agendacalendarview')
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.8.+'
compile 'com.github.clans:fab:1.6.4'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.github.d-max:spots-dialog:0.7#aar'
compile 'com.github.ganfra:material-spinner:2.0.0'
compile 'com.android.support:multidex:1.+'
}
apply plugin: 'com.google.gms.google-services'
You need to add -dontwarn or -ignorewarnings to all third-party libraryes in proguard-rules.pro You can find description on docs/wiki pages of them

adding firebase auth breaks gradle when in strange configuration

I am trying to use firebase messaging, auth and database in the same project, however when I try and add the auth dependence to gradle, as the firebase 'getting started' guide instructs, I get 2308 298 errors all related to build dependencies.
here is my app specific build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.name.withheld"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
maxProcessCount 4 // this is the default value
javaMaxHeapSize "2g"
}
// Enabling multidex support.
//multiDexEnabled true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
//I originally had all the play services enabled but now as a comment suggested I mm trying split dependencies.
//compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:design:24.1.1'
compile 'com.google.android.gms:play-services-base:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
also any way that I could speed up building would be helpful
edit:
I am still getting errors but this time they are about random com.google.android.gms: dependencies I have never heard of like
play-services-tasks
play-services-basement
LOCAL: internal_impl-24.1.1.jar
and ones I have used previously like
com.android.support:support-v4
com.android.support:recyclerview-v7
is there something that I did wronge to mess up my build enviroment, I am using android studios 2.1.2 on windows 8.1
compile 'com.google.firebase:firebase-auth:9.2.0'
Change all to 9.2.0 and check it once
Try this configuration:
build.graddle (Project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
build.graddle (Module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
multiDexEnabled = true
applicationId "com.xxxxxx.xxxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 24
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-storage:9.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.android.support:multidex:1.0.0'
compile 'org.apache.commons:commons-lang3:3.4'
}
apply plugin: 'com.google.gms.google-services'

no matter what I do I can't add realm to my project

this is my gradle file
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.nuku.mc.populate_recyclerview"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
incremental false
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath "io.realm:realm-gradle-plugin:0.88.3"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0'
compile 'com.mcxiaoke.volley:library:1.0.17'
compile 'com.github.bumptech.glide:glide:3.5.2'
}
}
1)I tried to compile
2) I tried removing this line ->
classpath 'com.android.tools.build:gradle:2.0.0'
3) I tried without the build script{...} and added classpath with my other dependencies but it's still saying:
and my gradle is saying:
Error(2,0) plugin with id 'realm-andoid' not found
Add the following line to your app module build.gradle file.
apply plugin: 'realm-android'
And and these lines to the project level build.gradle file.
dependencies {
classpath "io.realm:realm-gradle-plugin:1.1.0"
}
But it seems you add all of them in your app module build.gradle file.

Android Build tools -- No resource found that matches the given name: attr 'android:actionModeShareDrawable'

Just yesterday this app worked perfectly fine, yet now it is throwing errors concerning:
Here are my build files:
build.gradle (module app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 19//21
buildToolsVersion "20.0.0"//"21.1.2"
defaultConfig {
applicationId "(app)"
minSdkVersion 14
targetSdkVersion 19//21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.0.0'
//compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.squareup.picasso:picasso:2.5.1'
// Additional
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
compile 'com.mcxiaoke.volley:library:1.0.+'
//compile 'com.android.support:appcompat-v7:22.2.0'
}
How can I configure this to work?

Getting error --> "Execution failed for task" >NDK not configured

I am trying to compile my code on android studio and I am stuck at this point. I don't have any thing to compile using the ndk but everytime the compilation fails with this error.
When I check the workspace.xml it contains ExternalTaskPojo for compileDebugNdk and compileReleaseNdk.
I don't need them but can't figure out a way to remove them as it is an auto generated file.
Please suggest.
Edit -> build.gradle file
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':e')
compile 'com.android.support:support-v4:19.1.0'
}
Another build.gradle file
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':facebookSDK')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':volley')
compile project(':e')
compile project(':volley')
compile project(':f')
compile project(':g')
compile project(':h')
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/AF-Android-SDK-v1.3.16.0.jar')
compile files('libs/lib1')
compile files('libs/lib2')
compile files('libs/lib3')
compile files('libs/lib4')
compile files('libs/FlurryAgent.jar')
compile files('libs/renderscript-v8.jar')
compile files('libs/lib5')
}
After sometime I was able to fix my problem. I disabled the ndk-build by adding below property in the build.gradle file.
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build call
}

Categories

Resources