未能实例化一个或在Android Studio中多个类

问题描述 投票:3回答:1

我在更新的Android工作室进口现有的项目,当我打开我得到下面的错误该项目的文件:

failed to instantiate one or more classes android studio


rendering failed with a known bug

The following classes could not be instantiated
-android.support.design.widget.AppCompatButton
-android.support.design.widget.AppCompatEditText
-android.support.design.widget.AppCompatTextView

这是我的build.gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "com.lavazza"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    allprojects {
        repositories {
            mavenCentral()
        }
    }
    dexOptions {
        incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "2g"
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.3-alpha', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // Glide image library

    //SUB-DEPENDENCIES

    //Android-Iconics - used to provide an easy API for icons
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.jpardogo.materialtabstrip:library:1.0.9'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
    compile 'com.google.android.gms:play-services:10.2.4'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
    compile 'com.mikepenz:actionitembadge:3.3.1@aar'
    compile 'com.mikepenz:iconics-core:2.8.1@aar'
    compile 'com.github.rey5137:material:1.2.2'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:mediarouter-v7:25.3.1'
    testCompile 'junit:junit:4.12'
}

现在,我没有得到在Gradle文件中的任何错误。

我已经搜索并尝试了很多关于这个问题,我解决不了。请帮助我的人。

android android-studio
1个回答
0
投票
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "com.lavazza"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    allprojects {
        repositories {
            mavenCentral()
        }
    }

    dexOptions {
        incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "2g"
    }
}

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'
    })
    // Glide image library

    //SUB-DEPENDENCIES
    //Android-Iconics - used to provide an easy API for icons
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.mcxiaoke.volley:library-aar:1.0.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.jpardogo.materialtabstrip:library:1.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.mikepenz:actionitembadge:3.3.1@aar'
compile 'com.mikepenz:iconics-core:2.8.1@aar'
compile 'com.github.rey5137:material:1.2.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-annotations:26.0.0-alpha1'
}
© www.soinside.com 2019 - 2024. All rights reserved.