I am having this error on Android Studio:
Error:Failed to resolve: com.android.support:palette-v7:26.0.1
Install Repository and sync project
Open File
Show in Project Structure dialog
When I click 'Install Repository and sync project' nothing happens.
I already checked and tried similar questions's answers. But still problem exists.
Here is my project level build.gradle code:
// 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:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is my app level build.gradle code:
apply plugin: 'com.android.application'
apply from: "$rootDir/utils.gradle"
apply plugin: 'io.fabric'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
//repositories {
// maven { url 'https://maven.fabric.io/public' }
//}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
}
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
def applicationName = "xyz"
defaultConfig {
applicationId "xyz"
minSdkVersion 15
targetSdkVersion 26
versionCode 16
versionName "1.7"
manifestPlaceholders = [onesignal_app_id : "xyz",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField 'String', 'END_POINT', toJavaCodeString(END_POINT)
}
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
storeFile file('../keystore/debug.jks')
}
release {
keyAlias 'xyz'
keyPassword 'xyz'
storePassword 'xyz'
storeFile file('../../../Keystore/xyz.keystore')
}
}
productFlavors {
dev {
signingConfig signingConfigs.debug
versionCode defaultConfig.versionCode
versionName defaultConfig.versionName
applicationId "xyz"
}
prod {
signingConfig signingConfigs.release
versionCode defaultConfig.versionCode
versionName defaultConfig.versionName
applicationId "xyz"
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig getSigningConfig()
applicationVariants.all { variant ->
variant.outputs.each { output ->
def date = new Date();
def formattedDate = date.format('dd-MM - HH:mm:ss')
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-prod-release", applicationName + " v" + defaultConfig.versionName + " - " + formattedDate)
)
}
}
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), "rules-proguard-debug.pro"
signingConfig signingConfigs.debug
}
}
lintOptions {
abortOnError false
}
}
ext {
supportLibraryVersion = "26.0.1"
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://maven.google.com"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile "com.android.support:palette-v7:${supportLibraryVersion}"
compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
compile "com.android.support:cardview-v7:${supportLibraryVersion}"
compile "com.android.support:customtabs:${supportLibraryVersion}"
// compile "com.android.support:support-dynamic-animation:${supportLibraryVersion}"
compile 'com.tsengvn:typekit:1.0.1'
compile 'com.jakewharton.timber:timber:4.5.0'
compile 'com.mikepenz:iconics-core:2.8.2#aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0#aar'
compile 'com.mikepenz:community-material-typeface:1.7.22.1#aar'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'pub.devrel:easypermissions:0.2.1'
compile('com.github.ozodrukh:CircularReveal:2.0.1#aar') {
transitive = true;
}
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.balysv:material-ripple:1.0.2'
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
compile 'com.inthecheesefactory.thecheeselibrary:adjustable-imageview:1.0.0'
compile 'com.github.florent37:viewanimator:1.0.5'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
// compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.afollestad.material-dialogs:core:0.9.4.7'
compile 'com.afollestad.material-dialogs:commons:0.9.4.7'
// compile 'com.onesignal:OneSignal:3.+#aar'
// compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
def gmsVersion = '11.2.+'
compile("com.google.android.gms:play-services-gcm:${gmsVersion}") {
force = true
}
compile("com.google.android.gms:play-services-location:${gmsVersion}") {
force = true
}
compile("com.android.support:support-v4:${supportLibraryVersion}") {
force = true
}
compile("com.android.support:support-v13:${supportLibraryVersion}") {
force = true
}
compile("com.android.support:customtabs:${supportLibraryVersion}") {
force = true
}
compile 'com.google.android.gms:play-services-ads:' + gmsVersion
compile 'com.anjlab.android.iab.v3:library:1.0.+'
// compile 'org.solovyev.android:checkout:1.0.0'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
// testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
Project and app level build.gradle code added.
Any idea? Thanks!
This is the best way to do it.
In your root level gradle.build use below
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in your gradle-wrapper.properties file change the wrapper version as below
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip
also in your app level build.gradle make sure you are using 26 vesion as below
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxx"
minSdkVersion 16
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'
}
}
}
Related
I have been running into this error while trying to build my app and do not know how to resolve it, when I toggle Gradle offline mode, the error disappears but other dependency requires it to be turned off.
Could not GET 'https://google.bintray.com/exoplayer/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom'. Received status code 502 from server: Bad Gateway
Disable Gradle 'offline mode' and sync project
This is my build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.6.1'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my second buid.gradle
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.9'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
android {
signingConfigs {
release {
storeFile file('C:\\Users\\Osas Divine\\Desktop\\sckoolite\\unilorin-sckoolboy.jks')
storePassword '123456/'
keyAlias 'key0'
keyPassword '123456/'
}
}
compileSdkVersion 29
defaultConfig {
applicationId "com.sckoolboy.unilorin"
manifestPlaceholders = [onesignal_app_id: "d0989000-9ff3-4214-a42b-ed8f5a123456",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 19
targetSdkVersion 29
versionCode 11020
versionName '5.2.2'
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
archivesBaseName = "Sckoolboy"
useLibrary 'org.apache.http.legacy'
signingConfig signingConfigs.release
}
dexOptions {
jumboMode true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
implementation 'com.squareup.retrofit2:converter-gson:2.7.2'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.1'
..........
implementation('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
// google maps library ------------------------------------------------------------------------
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation('com.google.android.libraries.places:places:1.0.0') {
exclude module: 'glide'
}
}
apply plugin: 'com.google.gms.google-services'
I have searched a lot of posts about this issue and all of them apparently got resolved after upgrading to 'com.google.gms:google-services:4.0.2'from 3.3. However i am still getting the same error.
I need to use data binding for the project . Disabling it compiles the project, but i can't find a way around data binding
Any help would be appreciated
My project build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
flatDir {
dirs 'libs'
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
signingConfigs {
WalletAppSignConfig {
keyAlias '********'
keyPassword '********'
storeFile file('********')
storePassword '********'
}
}
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "********"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "RNS_MESSAGE_TAG", "\"payload\""
// Sample GCM ID
buildConfigField "String", "GCM_ID", "\"********\""
// Default location of the CMS-D
buildConfigField "String", "CMS_URL", "\"http://********/cms\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.WalletAppSignConfig
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
android{
dataBinding{
enabled=true;
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('********') {
transitive = true
}
compile '********'
compile('net.sf.flexjson:flexjson:3.2') {
transitive = true
}
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
//compile "android.arch.persistence.room:runtime:1.0.0-alpha4"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
//annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha4"
// compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.google.firebase:firebase-messaging:17.0.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
//compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
testCompile 'junit:junit:4.12'
}
android.applicationVariants.all { variant ->
task("_generate${variant.name}Javadoc", type: Javadoc) {
********
********
******** }
}
//apply plugin: 'realm-android'
I have following task in Project build.gradle file of Android Studio to test Google Cloud Endpoint. I want to run backend:appengineRun task in daemon mode so it allows the gradle process to continue.
Project-level build.gradle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.google.guava:guava:22.0'
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task runTestsInLocalServer {
dependsOn = ['runLocalServer', 'runAndroidTests', 'haltLocalServer']
}
task runAppEngine (dependsOn: ":backend:appengineRun") {
project(":backend").afterEvaluate { backend ->
backend.extensions.appengine.daemon = true
}
doLast {
println "started the server!"
}
}
task runAndroidTests {
shouldRunAfter 'runAppEngine'
dependsOn ':app:connectedCheck'
doLast {
println "Testing finished..."
}
}
task haltLocalServer {
shouldRunAfter 'runAndroidTests'
dependsOn ':backend:appengineStop'
doLast {
println "Server stopped..."
}
}
App level build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
}
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
flavorDimensions "default"
defaultConfig {
applicationId "com.udacity.gradle.builditbigger"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
free {
applicationId 'com.udacity.gradle.builditbigger.free'
dimension "default"
}
paid {
applicationId 'com.udacity.gradle.builditbigger.paid'
dimension "default"
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
endpointsServer project(path: ':backend', configuration: 'endpoints')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.api-client:google-api-client:1.23.0'
implementation 'com.google.http-client:google-http-client-android:1.23.0'
implementation 'com.google.code.findbugs:jsr305:3.0.1'
freeImplementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation project(':JokeProvider')
implementation project(':jokedisplay')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
}
Here is the Error that I get:
Caused by: groovy.lang.MissingPropertyException: Could not set unknown property 'daemon' for object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.
at org.gradle.internal.metaobject.AbstractDynamicObject.setMissingProperty(AbstractDynamicObject.java:118)
at org.gradle.internal.metaobject.AbstractDynamicObject.setProperty(AbstractDynamicObject.java:75)
at com.google.cloud.tools.gradle.appengine.core.AppEngineExtension_Decorated.setProperty(Unknown Source)
at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:197)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:484)
I suggest you to follow this doc.
I think you have to add some lines to your code (Project-level build.gradle):
repositories {
...
mavenCentral() <---
}
and
dependencies {
...
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.59' <---
}
I have Crashlytics working in my App.
I've added an Android Module to my App named 'engine-module' which has it's own Gradle dependencies.
I don't know how to import the Crashlytics dependency correctly and I just get the following error:
Error:(31, 13) Failed to resolve:
com.crashlytics.sdk.android:crashlytics:2.6.5
What I want to achieve is being able to access 'Crashlytics' from a Class within the 'engine-module' for example:
Crashlytics.setUserName("temp user name");
Is this possible? If so, how can it be achieved?
Project: build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
apply from: '../jacoco.gradle'
}
App/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.neenbedankt.android-apt'
/**
* Default values for configuration options
*/
def suffixDefault = ""
def versionCodeDefault = 1
def versionNameDefault = "developerBuilt"
/**
* Android-specific configuration
*/
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.flowmellow.projectx
minSdkVersion 16
targetSdkVersion 25
versionCode project.getProperties().get('versionCode') ? project.getProperties().get('versionCode').toInteger() : versionCodeDefault
versionName project.getProperties().get('versionName') ? project.getProperties().get('versionName') : versionNameDefault
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
// Configurable options
applicationIdSuffix project.getProperties().get('appIdSuffix', suffixDefault) + ".debug"
// Common options
testCoverageEnabled true
}
release {
// Configurable options
applicationIdSuffix project.getProperties().get('appIdSuffix', suffixDefault)
// Common options
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/**
* Dependencies
*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
//Dependency injection
apt 'com.google.dagger:dagger-compiler:2.7'
compile 'com.google.dagger:dagger:2.7'
provided 'javax.annotation:jsr250-api:1.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.1'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.hamcrest:hamcrest-library:1.1'
compile 'com.android.support.constraint:constraint-layout:+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
compile project(path: ':engine-module')
}
Module: engine-module/build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 16
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 fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:25.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
compile 'com.crashlytics.sdk.android:crashlytics:2.6.5'
}
SOLVED:
Project: build.gradle
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
apply from: '../jacoco.gradle'
}
Module: engine-module/build.gradle
apply plugin: 'com.android.library'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 16
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 fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:25.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
}
You did not define any repositories for the engine-module module, this means it cannot resolve the associated dependencies.
Generally people define repositories for their entire project by adding the following code to the root build.gradle
subprojects {
repositories {
// Add repositories here
}
}
This makes these repositories available for all subprojects.
I've regularly used the archivesbasename to rename my output apk's but since using the google-services plugin it is being ignored. Is there anything I can do to get this working again.
Attached my full build.gradle below, be grateful for any pointers.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
project.archivesBaseName = "MyApp";
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.codechimp.myapp"
versionCode 205
versionName "2.4"
minSdkVersion 14
targetSdkVersion 22
}
productFlavors {
prod {
}
dev {
versionName = android.defaultConfig.versionName + " dev"
}
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release }
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.google.android.gms:play-services-drive:7.5.0'
compile 'com.google.android.gms:play-services-plus:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.afollestad:material-dialogs:0.6.2.4'
compile 'com.google.code.gson:gson:2.3'
compile 'com.github.andrew-codechimp:androidutils:1.19'
}
def Properties props = new Properties()
props.load(new FileInputStream(file('signing.properties')))
if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
android.buildTypes.release.signingConfig = null
}
Project level build.gradle
// 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.2.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
This stopped working for me with android gradle plugin version 1.3.0 using 1.3.1 resolves it.
classpath 'com.android.tools.build:gradle:1.3.1'
Inside your build.gradle for the app you might have this.
android {
//...
defaultConfig {
//...
archivesBaseName = "myprojectname_v${versionName}_${versionCode}"
}
//...
}
If you want to change the APK name based on build type.
android {
//...
buildTypes {
special {
//...
archivesBaseName = "myprojectname_special_v${versionName}_${versionCode}"
}
}
//...
}