AndroidStudio 4.1 Problem with Sourcesets

Viewed 258
AndroidStudio version: 4.1
Device: MacBook Pro  MacOs 10.15.7
  • Step1: new a example project
  • Step2: new a module named mylibrary
  • Step3: create 'api' dir at mylibrary/src/main
  • Step4: modify build.gradle in app as followed
android {
    ...
    sourceSets{
        main{
            java.srcDirs "${rootDir}/mylibrary/src/main/api"
        }
    }
}

mylibrary cannot recognize java file!

enter image description here

1 Answers

I had loads of issues with the new android 4.1 update I then updated the version to Android Studio 4.1 RC 2 https://developer.android.com/studio/archive the link to the download is there give it a try if it don't work just go back to 4.0

Related