错误表象

1
2
3
4
5
6
7
8
9
Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

最新的解决方法:

第一步:将Android Studio更新到3.1.3

第二步:将工程进行Clean

第三步:更新gradle至4.4版本

然后,你可以看到如下效果:

以后每次编译都会自动进行gobind了,不像之前必须得手动运行gomobile bind -a -v -target=android ., Enjoy ;-) !