How to Add -Xlint:Unchecked to My Android Gradle Based Project

The project is not a Gradle-based project. How do I open the project from the root directory?

Your project is not Gradle based because settings.gradle and bulid.gradle are not in the IDE project directory, they are in that blacked-out subfolder under .idea and .gradle in your picture.

You must close this project. Open that other folder as an Android Studio Project, regardless of where you got that project from.

For library projects in Github, it would look like this. Anyone can clone this as-is and open as a project.

For apps, replace sample with app, and remove library

Sample Image


Most importantly, buildscript and allprojects section should not be in /app/build.gradle, only /build.gradle

Additionally, your Gradle build plugin is outdated

Android studio: this project is not gradle based project

Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file.

The missing top level gradle file is what causes this error.

ANDROID STUDIO: this project is not a gradle-based project

Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file.

The missing top level gradle file is what causes this error.

Creating a gradle based android project via command line

Use the -g option when creating the project. For more details, try

android create project -h



Related Topics



Leave a reply



Submit