> Task :prepareKotlinBuildScriptModel UP-TO-DATE
<ij_msg_gr>Gradle import errors<ij_msg_gr><ij_nav>D:\Important_Docs\Projects\Backup\RLPHYC\android-utils\build.gradle<ij_nav><i><b>project ':android-utils': Unable to build Kotlin project configuration</b><eol>Details: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':android-utils:generateLintModuleInfo'.<eol>Caused by: java.lang.IllegalStateException: Extension not initialized yet, couldn't access compileSdkVersion.</i>
<ij_msg_gr>Gradle import errors<ij_msg_gr><ij_nav>D:\Important_Docs\Projects\Backup\RLPHYC\app\build.gradle<ij_nav><i><b>project ':app': Unable to build Kotlin project configuration</b><eol>Details: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:generateLintModuleInfo'.<eol>Caused by: java.lang.IllegalStateException: Extension not initialized yet, couldn't access compileSdkVersion.</i>
Extension not initialized yet, couldn't access compileSdkVersion.
Tried to invalidate cache restart also used ext in top-level Gradle and also deleted Gradle folder Still error continues
No problem with the Gradle version tried the same with different Gradle versions
like @Vacexe said, this is dexcount plugin's bug.
You can resovle this problem by update dexcount plugin version to 2.0.0:
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0'
I have the same issue in our project after uplift gradle plugin to 4.1.0 version and it has been solved by removing this plugin
apply plugin: 'com.getkeepsafe.dexcount'
They removed some deprecated methods from the DSL. So not-up-to-date plugins will crash miserably on this update. In fact, issue can come from any gradle plugin that uses deprecated methods from the gradle Android DSL. Just run
$ ./gradlew clean assemble --stacktrace
to understand what plugin calls a deprecated (removed) method, and in general this plugin has a more recent version that no longer uses the deprecated DSL method. In my case, this was junit5, but one has to do the per-case verification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With