I have searched around a lot but I cannot really find a post that helps I am somewhat new to android so some of this goes over my head. Anyway, my problems started when I got an error saying gradle plugin was old and the sync would not complete. So I changed a few things around not really sure what I did. Now I have:
Error(25,13) Failed to resolve: com.android.support:appcompat-v7 24.0.1
Project gradle file:
// 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.1.3'
// 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
}
app gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.bisesifreelance.maxbisesi.tic_tac_toe"
minSdkVersion 23
targetSdkVersion 24
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'])
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:24.0.1'
testCompile 'junit:junit:4.12'
}
Also I have installed all build tools in SDK manager I'm not allowed to embed images yet? but it says:
Android SDK Plaform-Tools 24.03 installed
Android SDK Tools 25.2.2 installed
Thank YOu! I'm very lost.
You can also write like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
try
compile 'com.android.support:appcompat-v7:24.2.1'
EDIT
For sdk 27
buildToolsVersion "27.0.3"
implementation "com.android.support:appcompat-v7:27.1.1"
Try adding jcenter
like this way
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
Rather than
repositories {
jcenter()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With