关于Android Studio 3.4.1以及gradle 3.4.1版本下kotlin工程报错New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version的问题,
暂时的解决办法是使用旧版本,我这里是退回gradle 3.3.2版本
classpath 'com.android.tools.build:gradle:3.3.2'
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Sync之后会有警告:
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageLibrary(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
不用管,将就用先;
但是有个很奇怪的问题,在我想复现报错的时候,改回3.4.1版本后编译也不报错了,当然上面那个警告依旧会有,奇怪
classpath 'com.android.tools.build:gradle:3.4.1'
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip