Being told project is not using the gradle build system when it is

后端 未结 6 1339
情书的邮戳
情书的邮戳 2021-02-13 01:34

When I open my project in Android Studio, I always get this. \"Error

Back when Android Stu

相关标签:
6条回答
  • 2021-02-13 02:05

    In my case the the problem was that studio version I am using does not support the gradle version of file, so in build.gradle I had to change the gradle version to 2.3.0 and everything is smooth now

    0 讨论(0)
  • 2021-02-13 02:11

    I fixed this issue with the following steps:

    1. Make sure that the following two files are in your project directory. If not, create a new one with reference of your other Android projects. These are default auto-generated files.

      1. settings.gradle
      2. build.gradle
    2. If it is still showing any errors when you open your project, restart your project by selecting file/(invalidate /restart).

    0 讨论(0)
  • 2021-02-13 02:18

    import Project

    File --> New -->import Project

    0 讨论(0)
  • 2021-02-13 02:20

    The android studio support two "build mode". one is "legacy" and one is "gradle based". If you are using an very early version of android studio, probably you are still using the legacy build mode. You need to re-import your project using "gradle mode" then this warning will be gone.

    To do so, select "file/import project", select your project root directory, and in the next dialog choose "Import project from external model" and select gradle. Then, you may choose "gradle wrapper" or use your own gradle distribution (1.8 for now[12/2013]).

    0 讨论(0)
  • 2021-02-13 02:21

    i know this is an old question but is still valid with newer versions of AS.

    If you try to import and import againa and still have the same issue, check if there's a gradle.build file on the root directory, if there's not just create one.

    In my case I had to migrate an old project to the new version because with the 0.4.4+ version it stopped recognizing it, and it kept failing, and that was the problem.

    Curious thing is the top level build.gradle file just contains this comment:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    0 讨论(0)
  • 2021-02-13 02:25

    This link can help, https://developer.android.com/studio/intro/migrate.html

    Import as a Project:

    1. Start Android Studio and close any open Android Studio projects.
    2. From the Android Studio menu click File > New > Import Project. Alternatively, from the Welcome screen, click Import project (Eclipse ADT, Gradle, etc.).
    3. Select the Eclipse ADT project folder with the AndroidManifest.xml file and click Ok.
    0 讨论(0)
提交回复
热议问题