22 Dec 2017 Error that occurred while offline
AfterswitchingtoOnlineWork
ORIGINAL:I'vebeentryingtoavoiddoingitthisway:
dependencies{compilefileTree(include:['*.jar'],dir:'libs')compile'com.android.support:appcompat-v7:26.+'
Becausetheuseof'+'isdiscouraged,Gradlecannever'resolvedependencies'ifIuse
...v7:26.1.1ouv7:27.0.2(comosdevidosajustes)
oranyotherversionyoumayfindontheweb.
IputdownthecompletecodeoftheAppbuild.gradle(in1st)andthebuild.gradleoftheproject(in2nd).
Iask:a)HowdoIavoid'+'?b)WherecanIfindtheversions(26.x.x,forexample)thatexistandcanbecompiled?
applyplugin:'com.android.application'android{compileSdkVersion26//23buildToolsVersion'26.0.3'defaultConfig{applicationId"com.example.android.LearnEnglish"
minSdkVersion 15
targetSdkVersion 26//23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
google()
//maven { url "https://maven.google.com" } Este só se usa com Gradle abaixo de 4.1
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.+'
//compile 'com.android.support:support-v4.app.ActivityCompat'//com.android.support:support-compat:+'
//compile 'com.android.support:support-v4:23.3.0'
//compile 'com.android.support:design:23.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
/*compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'*/
}
(project:)
buildscript {
repositories {
// Gradle 4.1 and higher include support for Google's Maven repo using
// the google() method. And you need to include this repo to download
// Android plugin 3.0.0 or higher.
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}