Package name does not correspond to the file path

android, android-studio

Solution

Since your gradle.build file is in the main directory, it views the first `src` folder as the one containing the source. Try changing `java.srcDirs` to `['src/main/src']`.

Problem

My android studio project is compiling as it should, but there's one annoying issue. Android studio gives me this warning: Package name does not correspond to the file path The file path declared in the source code is something like `com.example.<classes>` but it asks me to rename it to `main.src.com.example.<classes>` When I do that, it no longer compiles. My source code is in the `src/main/src` folder. My `build.gradle` contains this ``` sourceSets { main { java.srcDirs = ['src'] } instrumentTest.setRoot('tests') } ```

Original source