2
22 Dec 2017 Error that occurred when with Offlinework
After switching to Online Work
ORIGINAL: I’ve been trying to avoid doing it that way:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.+'
because the use of '+' is discouraged, but Gradle can never "solve dependencies" if I use
...v7:26.1.1 ou v7:27.0.2(com os devidos ajustes)
or any other version you can find on the web.
I put down the full code of the build.Radle of the App (in 1º) and the build.Radle of the project (in 2º).
I ask you: to) How to proceed to avoid the '+'? b) Where can I find the versions (26.x.x, for example) that exist and can be compiled?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26//23
buildToolsVersion '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
}
It seems that the base error comes from something related to the certificates. I updated the original post with bug photos.
– Pietrov
Try version 26.1.0, I’m also having some problems with version 27.0.2, I managed to use version 27.0.0 at most.
– Paulo Abreu
Fixing: I was able to use version 27.0.1 at most (make sure in SDK Manager that the version used is installed)
– Paulo Abreu