首页 > 解决方案 > Android Studio:错误“无法解决:设计”?

问题描述

嗨,我在 gradle 项目同步时收到此错误消息。

“未能解决:设计”

我找不到这是什么。

有没有朋友可以帮我解决这个问题?或者你有另一个图标包 Android Studio 项目吗?

它来自 CandyBar-Sample-Master android 图标包项目。

apply plugin: 'com.android.application'

android {

    compileSdkVersion rootProject.ext.CompileSdk

    android.applicationVariants.all { variant ->
        variant.outputs.all { output ->
            def appName = parent.name
            def fileName = appName.replace(" ", "_")
            outputFileName = "$fileName-v${variant.versionName}.apk"
        }
    }

    defaultConfig {
        applicationId "com.grafiman.icons.selero"
        minSdkVersion rootProject.ext.MinSdk
        targetSdkVersion rootProject.ext.TargetSdk
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '27.0.3'
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])


    implementation 'com.github.danimahardhika.candybar-library:core:3.5.0-b4'
}

标签: android-studioandroid-gradle-plugin

解决方案


// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {

    repositories {
        mavenCentral()
        jcenter()
        google()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.google.com' }


    }

    //NOTE: This is important
    rootProject.ext {
        BuildTools = "27.0.3"
        MinSdk = 15
        TargetSdk = 26
        CompileSdk = 26
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}


推荐阅读