Problems with update android studio 2.1.3

2

I get the error message when synchronizing with gradle 2.14 and jdk 1.8:

  

Gradle sync failed: Could not initialize class   com.google.common.reflect.Types $ NativeTypeVariableEquals

When I give clean to the project it gives me this other error when synchronizing

  

Error: Could not create an instance of type org.gradle.api.internal.project.DefaultProject_Decorated.   Could not initialize class com.google.common.reflect.Types $ NativeTypeVariableEquals

or sometimes this

  

Error: (class: com / google / common / reflect / Types $ TypeVariableImpl, method: isAnnotationPresent signature: (Ljava / lang / Class;) Z) Illegal use of nonvirtual function call

build.gradle (app)

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.example.yas.myapplication"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),  
'proguard-rules.pro'
    }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:design:22.1.1'
}

build.gradle

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
}*
    
asked by Yasel 05.09.2016 в 21:22
source

1 answer

1

Reviewing your problem, at the end of this Thread comments a Gradle engineer the configuration you require when directories are defined within build.gradle , in your case:

compile fileTree(dir: 'libs', include: ['*.jar'])

Since your problem is similar to the thread.

However it seems to me that what causes the problem is that you do not have defined the .jar that contains the class inside your folder /libs :

    
answered by 07.09.2016 в 21:24