Intellij Idea import gradle project error - “Cause: unexpected end of block data”

前端 未结 9 515
一向
一向 2020-12-19 02:02

While importing project as gradle have error Cause: unexpected end of block data. Project has several modules. I\'m using Idea 132.719 and 1.8 gradle.

相关标签:
9条回答
  • 2020-12-19 02:56

    I see in your comments, @SergeyB, that deleting .gradle in your user dir didn't help, but these steps resolved my issue (which had similar symptoms):

    • Delete .gradle directory from user dir (\Users\Mark.gradle)
    • Delete GRADLE_HOME environment variable, if it's set
    • Delete "manual" installs of Gradle (which shouldn't be needed, since Gradle will automatically download the necessary files when you run the gradlew wrapper)
    • Run "gradlew" from command-line, and confirm that new files are downloaded
    • Run a gradle build from the command-line (e.g., "gradlew clean assemble")
    • If you get an SDK version mismatch error, such as "failed to find target android-18", be sure to download the corresponding Android SDK (which can be done via the SDK Manager in Android Studio)
    • Once you can build from the command-line, try again from within the IDE
    0 讨论(0)
  • Try applying the idea plugin in Gradle and running it. Then open the project in IntellijIDEA with the .ipr file that is generated.

    0 讨论(0)
  • 2020-12-19 03:00

    I had the same problem just after installation Android Studio version 0.6.1. The buildToolsVersion in \app\build.gradle pointed to correct version (19.0.3) however problem was fixed by changing it to version 19.1

    android {
    compileSdkVersion 19
    buildToolsVersion "19.1" // <- This was changed from 19.0.3
    ...
    
    0 讨论(0)
提交回复
热议问题