In your build.gradle file, add the following to the end of the Android node:
android {
....
....
sourceSets {
main.java.srcDirs += 'src/main/<YOUR DIRECTORY>'
}
}
More Related Contents:
- Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio
- Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
- How to set -source 1.7 in Android Studio and Gradle
- Gradle – What is a non-zero exit value and how do I fix it?
- Import Google Play Services library in Android Studio
- UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define
- Manifest merger failed error
- :app:dexDebug ExecException finished with non-zero exit value 2
- Android studio – Failed to complete gradle execution – error in opening zip file
- Android studio – Failed to find target android-18
- Gradle sync failed: Unable to find method
- Failed to import new Gradle project: failed to find Build Tools revision *.0.0
- Android Studio Build gradle OutOfMemoryError
- Error:Timeout waiting to lock buildscript class cache for build file when change minSdkVersion
- Importing Facebook library in Android Studio: Could not find property ‘ANDROID_BUILD_SDK_VERSION’
- Android Studio 3.0 DexArchiveBuilderException
- Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler
- How to add local .jar file dependency to build.gradle file?
- Is it possible to declare a variable in Gradle usable in Java?
- How can I convert a part of Java source file to Kotlin?
- cannot resolve symbol ‘java.time.LocalDate’ error in android studio
- Building an uberjar with Gradle
- How can I resolve the error “The minCompileSdk (31) specified in a dependency’s AAR metadata” in native Java or Kotlin? [duplicate]
- Which JDK version (Language Level) is required for Android Studio?
- Gradle sourceCompatibility has no effect to subprojects
- IntelliJ Build Error Context Mismatch
- Exporting and running Unity3D project to Android Studio
- Android: How to configure FFMPEG latest version in android studio?
- Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio
- Where do resource files go in a Gradle project that builds a Java 9 module?