Can we have project without app folder in android studio with everything (java/res/etc) in root

后端 未结 2 1281
天命终不由人
天命终不由人 2021-01-25 21:55

I would like to know that is it possible to have android project without Application module (app or any other name) in Android studio?

Means i can create package and res

2条回答
  •  爱一瞬间的悲伤
    2021-01-25 22:15

    Please refer "Configuring the Structure" section in https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/user-guide. You can specify a different sourceSet

    android {
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
    
            androidTest.setRoot('tests')
        }
    }
    

提交回复
热议问题