Android studio can not recognise an old version of gradle file - android

I am trying to open a project i created and developed long time ago using android studio. but every time i try to open and run the project i receive the following errors. that project was working normally without any errors in gradle files.
please let me know how to fix it
error:
ERROR: Failed to resolve: com.android.support:appcompat-v7:26.0.1
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support:recyclerview-v7:26.0.1
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support:support-annotations:28.0.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.2.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app
gradle project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
maven {
url "https://jitpack.io"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.pc_amr.retrofit_3"
minSdkVersion 15
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
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:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.solidfire.code.gson:gson:2.6.2'
compile 'com.google.code.gson:gson-parent:2.8.1'
compile 'com.solidfire.code.gson:gson-parent:2.6.2'
compile 'com.android.support:support-annotations:28.0.0'
}

Maven repository is missing, so do it as follows, in porject level gradle file
allprojects {
repositories {
// If you're using a version of Gradle lower than 4.1, you must instead use:
maven {
url 'https://maven.google.com'
}
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
jcenter()
}
}

Related

Android Studio after upgrade errors "Gradle sync failed: ..."

My app build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.marcus.exceltest"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'org.apache.poi:poi:4.1.1'
implementation 'org.apache.poi:poiooxml:4.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
}
My Gradle build.gradle
// 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.5.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My Gradle.properties
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
The Error:
ERROR: Gradle DSL method not found: 'implementation()'
Possible causes:
The project 'Exceltest' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.5.2 and sync project
The project 'Exceltest' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin
The Event Log:
18:27 Gradle sync failed: Could not find method implementation() for arguments [androidx.appcompat:appcompat:1.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. (950 ms)
18:27 NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN
18:28 Error running 'Exceltest': Gradle project sync failed. Please fix your project and try again.
Everything worked before I upgraded to Android Studio v3.5.2, tried all suggestions offered by AS but I'm having difficulty in trying to update manually, both the gradle upgrade and the tools upgrade. I'm very new to AS, I have looked at previous answers but they relate to much older versions or file systems do not exist in my version. Please can someone help?
You wrote it in wrong place implementation androidx.appcompat:appcompat:1.1.0 remove this line from your gradle build.gradle below gradle classpath
There is an error in your project's build.gradle file. It should look like this
// 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.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Everything seems fine but,
1. Some Library you migrated into Androidx and some not so i request you to migrate your project's all library into androidx.
2. Remove implementation line from your project level gradle file or move it to App level gradle file.

Android studio unable to build my app after gradle plugin updated

I updated the Gradle plugin yesterday and now the android studio is not able to build my app. The app shows the following error.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app
My app level build.gradle file looks like this:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.mvp1stockmeter"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding
{
enabled true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-firestore:18.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
implementation 'com.google.firebase:firebase-auth:16.1.0'
//implementation 'com.facebook.android:facebook-android-sdk:4.x'
implementation 'com.jjoe64:graphview:4.2.2'
}
apply plugin: 'com.google.gms.google-services'
My project level build.gradle file looks like this:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.26.1'
// 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
}
I searched this on StackOverflow and google as well. But did not find any information. Please help. I am stuck here.
I don't have a clue why this is happening, but it is happening since yesterday, March 21 2019. I think it is a problem in the maven repository? Because the url where android studio is trying to get that library is down.
Anyway, the fix is to "manually" point AS to that missing dependency, adding this line into your build.gradle, inside dependencies{...}
implementation group: 'io.grpc', name: 'grpc-core', version: '1.16.1'
Then sync, then you can delete that line.
Well, I hope someone can explain what happened.
Adding mavenCentral() to allprojects{} section of project level build.gradle file has resolved this issue for me.
Adding mavenCentral() to buildScript{} section of project level build.gradle file has resolved this issue for me. Thanks for your support.
I had three build errors of the following type:
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.28.0].
As with many of these android studio related issues,
File -> Invalidate Caches / Restart...
did the trick for me.
Delete this line :- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"...It worked for me
Add mavenCentral() to your buildscripts->repositories and allprojects->repositories both places and sync the project.

Error:Could not find com.android.tools.build:gradle:3.3. Issue raise after upgrading gradle version for splunk:mint-android-sdk

My App was working fine, then i add com.splunk:mint-android-sdk, which required upper version of gradle, so i upgrade the gradle to from 2.1 to 3.3. after that i am facing issues. Please review my gradle file and help me out and please guide me how it work.( This is my first app but i want sure make its should be working fine in all scenario )
Error:Could not find com.android.tools.build:gradle:3.3.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.jar
https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.pom
https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.jar
Required by:
:MyApp:unspecified
My gradleare
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.abc.myApp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled= true
manifestPlaceholders = [onesignal_app_id: "hjaadsffsddd8-2e6hgf-4fdsasdfgb63-8dad5-1111111",
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:+'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.onesignal:OneSignal:[3.6.1,3.99.99]'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.splunk:mint-android-sdk:5.2.1'
}
and
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.splunk:mint-gradle-android-plugin:5.2.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Inside buildscript add google() then open terminal write command-- gradlew build and press enter.
repositories {
google()
jcenter()
}
NB: Make sure you are in active network connection
You changed Gradle plugin version, not Gradle version
Set your Gradle Plugin version to 2.3
Then open gradle/wrapper/gradle-wrapper.properties and change Gradle version at line distributionUrl
Please follow these steps :
Open Your project.
Go to the Left side of the Gradle button.
Click button above image show .
if this type of view you are not in offline mode.
Go to Build and rebucild the project.
The above worked for me.
This version of the gradle plugin doesn't exist.
classpath 'com.android.tools.build:gradle:3.3'
use the latest beta release:
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
Instead if you would like to update gradle, update the distributionUrl in gradle-wrapper.properties.
I resolve my problem removing proxy configuration in file gradle.properties
I've got this error, and the problem was the antivirus Avast blocking android studio from download the files.
so I've disabled it temporary and also runned Android studio as an admin. this solved the problem.
In my case, I add maven { url 'https://maven.google.com' } at top of build script.
Go to the gradle wrapper properties and see if the gradle version in the distribution url matches the one in the build.gradle classpath's
I updated following line of
code: classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
and distributionUrl in gradle-wrapper.properties 'distributionUrl=https\://services.gradle.org/distributions/‌​gradle-3.3-all.zip'
and MOST IMPORTANT is FILE>SETTING>Build,Execution,Deployment>Build Tools>Gradles: Project-level settings: checked :Use default gradle wrapper(recommended)

Could not find com.google.firebase:firebase-core:9.0.0?

In my app, I am trying to use gcm services, but I cannot even get gradle to compile. I keep getting the message that I am missing 'firebase core' though I have no idea how to install this.
This is my top-level gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath "io.realm:realm-gradle-plugin:1.1.0"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
}
And here is my module-level gradle file:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "roof.android"
minSdkVersion 17
targetSdkVersion 23
versionCode 11
versionName "0.0.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/NOTIC E.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.properties'
exclude 'META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.xml'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// "The Android Support Library package contains several libraries that can be included in your application" -- https://developer.android.com/topic/libraries/support-library/features.html
compile 'com.android.support:appcompat-v7:24.0.0'
// "Native android recycler view library" -- https://developer.android.com/topic/libraries/support-library/features.html
compile 'com.android.support:recyclerview-v7:24.0.0'
// "A powerful image downloading and caching library for Android" -- http://square.github.io/picasso/
compile 'com.squareup.picasso:picasso:2.5.2'
// "Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster" -- https://developer.android.com/training/volley/index.html
compile 'com.android.volley:volley:1.0.0'
// "JsonWebTokens in Auth0" -- https://auth0.com/docs/jwt
compile 'com.auth0:java-jwt:2.1.0'
// "Joda-Time provides a quality replacement for the Java date and time classes" -- http://www.joda.org/joda-time/
compile 'joda-time:joda-time:2.8.1'
// "Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel" -- https://github.com/Cloudist/ACProgressLite
compile 'cc.cloudist.acplibrary:library:1.2.1'
// "A RecyclerView that is powered by Realm and lots more" -- https://github.com/thorbenprimke/realm-recyclerview
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.22'
// "A beautiful ripple animation for your app" -- https://github.com/skyfishjy/android-ripple-background
compile 'com.skyfishjy.ripplebackground:library:1.0.1'
// "A logger with a small, extensible API which provides utility on top of Android's normal Log class." -- http://jakewharton.github.io/timber/
compile 'com.jakewharton.timber:timber:4.1.2'
// "Field and method binding for Android views" -- http://jakewharton.github.io/butterknife/
compile 'com.jakewharton:butterknife:8.1.0'
apt 'com.jakewharton:butterknife-compiler:8.1.0'
// "An HTTP+HTTP/2 client for Android and Java applications." -- http://square.github.io/okhttp/
compile 'com.squareup.okhttp3:okhttp:3.3.1'
// "Android client for Sentry"
compile 'com.joshdholtz.sentry:sentry-android:1.4.1'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
}
In your module Gradle file (usually the app/build.gradle), add the apply plugin(apply plugin: 'com.google.gms.google-services') line at the bottom of the file to enable the Gradle plugin.
You should also add the dependencies for the Firebase com.google.firebase:firebase-core and com.google.firebase:firebase-messaging SDK's:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Make sure you have the latest version of 'Google Play services' and 'Google Repository' installed while using Firebase.
Please follow below steps to install:
Open Android studio
Go to the Menu bar > Tools > Android > SDK Manager
Click on Tab > SDK Tools
Check and install 'Google Play Services' and 'Google Repository'
Click on Apply and wait for the download
Finally, Sync and build your project again.
You want to add push notifications in your app ?
use firebase instead of GCM. it is enhanced version of GCM.
You need following dependencies for firebase push notifications.
compile 'com.google.firebase:firebase-messaging:9.0.1'
compile 'com.google.android.gms:play-services-gcm:9.0.1'
for further info visit http://codingaffairs.blogspot.com/2016/06/firebase-cloud-messaging-push.html
I had the same problem with com.google.firebase:firebase-core:11.8.0 and it worked after moving the google() repository above jcenter().
In between I used Build -> Clean Project.
./build.gradle
buildscript {
repositories {
google() // <- now on top!
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google() // <- now on top!
jcenter()
}
}
If you want to add the firebase core, you can add
compile 'com.google.firebase:firebase-core:9.0.0'
under dependencies tag in your module-level gradle file.
If you still can't resolve it, maybe you need to update the SDK to get the Google Play Services rev 30 and Google Repository rev 26 first. See here for the detail.
In your android/build.gradle in your repositories section, try moving google() ABOVE jcenter().

configuration issue. "Configuration with name 'default' not found"

I am relatively new to Android development and VERY new to Android Studio (much more experienced with Eclipse + android plugin). I am trying to edit a github project, but I can't seem to get it to even compile! I have been reading up, and my error seems to have to do with the build.gradle/locations of libraries themselves.
My error is:
Error:Configuration with name 'default' not found.
It also says "Gradle project sync failed, but I think its related to the above error…whatever that means.
My outer build.gradle is:
// 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:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
And my inner build.gradle file is:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
defaultConfig {
applicationId "com.wisely.loyalty"
minSdkVersion 14
targetSdkVersion 18
versionCode 17
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':facebook')
compile project(':cwac')
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
compile('org.apache.httpcomponents:httpmime:4.3.5') {
exclude module: "httpclient"
}
compile 'com.android.support:support-v13:20.0.0'
compile 'com.google.android.gms:play-services:5.0.+'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
compile 'com.makeramen:roundedimageview:1.3.0'
compile 'com.crashlytics.android:crashlytics:1.+'
}
EDIT:
General file hierarchy
root
.idea
app
libs
cwac
fb
utils
src
… all source files
gradle
build.gradle
settings.gradle
External Libraries
Android API 20 Platform
JDK
EDIT: Settings.gradle:
include ':app', ':facebook', ':cwac', ':utils'
project(':facebook').projectDir = new File('app/libs/facebook')
project(':cwac').projectDir = new File('app/libs/cwac')
project(':utils').projectDir = new File('app/libs/utils')
Progress Update:
I've tried moving the library files around in the directory to no avail. I also tried using my eclipse environment which just seemed to have even more issues. I really need to get this project configured properly!
UPDATE #2:
I have a strong feeling that this has to do with the gradle version since the file configuration seems fine, and its likely my computer that is lacking something. I am new to using gradle. Is there a way to update it? Or is it simply updated through the support libraries in the sdk manager?
Add your library folder in your root location of your project and copy all the library files there. For ex YourProject/library then sync it

Categories

Resources