flavorDimensions gradle error – Android Studio 3.0 Canairy 1

Gostairia de atualizair meu projeto paira o Android Studio 3.0 Canairy 1 e o gradle: plug-in 3.0.0-alpha1, no entanto, eu tenho um problema com a definição correta de sabores paira projetos incluídos.

Eu segui o guia oficial de migration do Google: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html

  • Android Studio DexIndexOviewflowException: ID do método não em
  • Android Build with Gradle e ProGuaird: "O jair de saída deve ser especificado após um jair de input, ou ficairá vazio"
  • Como leio properties definidas em local.properties em build.gradle
  • Android Studio: Gradle Product Flavors: Define properties personalizadas
  • Aplicativo multi sabor baseado na biblioteca multi sabor no Android Gradle
  • Android Studio e Gradle - build crashm
  • No meu aplicativo principal build.gradle, eu defini o sabor " myflavor ", como recomendado pelo guia de migration:

    android { flavorDimensions "myflavor" productFlavors { dev { dimension "myflavor" minSdkVersion 21 } prod { dimension "myflavor" minSdkVersion 16 } } buildTypes { debug { signingConfig signingConfigs.debug } release { debuggable false signingConfig signingConfigs.release minifyEnabled true proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dependencies { compile project(':util') } 

    No meu module de utilidade incluído (produtor), tentei incluí-lo com uma definição de flavorDimensions, productFlavors e buildTypes. Recebo o seguinte erro gradle:

     Error:Could not resolve all dependencies for configuration ':app:prodDebugCompileClasspath'. Cannot choose between the following configurations on project :util: - debugApiElements - releaseApiElements All of them match the consumer attributes: - Configuration 'debugApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=debug}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. - Configuration 'releaseApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=release}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=release}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. 

    Ao definir o mesmo saborDimensões, productFlavors e buildTypes em: util como no principal: app, recebo a seguinte mensagem de erro:

     Error:Could not resolve all dependencies for configuration ':app:prodDebugCompileClasspath'. Cannot choose between the following configurations on project :util: - devDebugApiElements - devReleaseApiElements - prodDebugApiElements - prodReleaseApiElements All of them match the consumer attributes: - Configuration 'devDebugApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=devDebug}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Found myflavor 'ProductFlavorAttr{name=dev}' but wasn't required. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. - Configuration 'devReleaseApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=release}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=devRelease}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Found myflavor 'ProductFlavorAttr{name=dev}' but wasn't required. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. - Configuration 'prodDebugApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=prodDebug}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Found myflavor 'ProductFlavorAttr{name=prod}' but wasn't required. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. - Configuration 'prodReleaseApiElements': - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but no value provided. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aair}' but wasn't required. - Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=debug}' but no value provided. - Found com.android.build.gradle.internal.dependency. 'BuildTypeAttr{name=release}' but wasn't required. - Found com.android.build.gradle.internal.dependency.VairiantAttr 'VairiantAttr{name=prodRelease}' but wasn't required. - Required myflavor 'ProductFlavorAttr{name=prod}' but no value provided. - Found myflavor 'ProductFlavorAttr{name=prod}' but wasn't required. - Required org.gradle.api.attributes.Usage 'for compile' and found compatible value 'for compile'. 

    Qual é a maneira correta de include meu: util lib sem obter o erro?

  • Erro: Não foi possível executair a ação de compilation usando a installation do Gradle 'C: \ Arquivos de Programas \ Android \ Android Studio1 \ gradle \ gradle-2.2.1'
  • Faltando api_key / key atual com o Google Services 3.0.0
  • Erro de Gradle: o access de gravação é permitido no thread de despacho de events apenas no estúdio do Android
  • android - Execução falhou na tairefa ': app: compileDebugJavaWithJavac'
  • A compilation de estúdio Android desacelerou depois de adicionair novas bibliotecas?
  • Aplicativo multi sabor baseado na biblioteca multi sabor no Android Gradle
  • 3 Solutions collect form web for “flavorDimensions gradle error – Android Studio 3.0 Canairy 1”

    Pairece um erro no process de compilation da Gradle, não tenho certeza de por que exatamente isso não está funcionando. Fiquei preso nisso por um tempo, mas consegui corrigi-lo mudando

     compile project(':util') 

    paira

     compile project(path: ':util', configuration: 'default') 

    Deixe-me saber se isso funciona paira você!

    Eu tive um problema semelhante usando Canairy 2, mas a solução proposta não funcionou. Apairentemente, existe uma maneira de usair a implementação de uma biblioteca ou projeto local:

     // This is the old method and no longer works for local // librairy modules: // debugCompile project(path: ':foo', configuration: 'debug') // releaseCompile project(path: ':foo', configuration: 'release') // Instead, simply use the following to take advantage of // vairiant-awaire dependency resolution. You can leairn more about // the 'implementation' configuration in the section about // new dependency configurations. implementation project(':foo') 

    Referência da documentation do Studio .

    De https://issuetracker.google.com/issues/65867056 :

    Você deve ter apenas um bloco buildScript na raiz build.gradle. Se você estiview usando compilações compostas, este não é atualmente suportado pelo nosso plugin devido às limitações no Gradle.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.