Records related to Gradle multi-channel packaging

Article directory

SourceSets settings

sourceSets {
	main {
		manifest.srcFile 'AndroidManifest.xml'
		java.srcDirs = ['src']
		aidl.srcDirs = ['src']
		renderscript.srcDirs = ['src']
		res.srcDirs = ['res']
		assets.srcDirs = ['assets']
    resources.srcDirs = ['src']//这条是关于配置资源文件路径的
	}
}

Note: When configuring the above path in the gradle of the App directory, an exception will be thrown, prompting you that the Manifest file cannot be found. This is because your Manifest file is in the app/src/main directory, so it will not be found.
My iterative processing here is to pull the assets directory, res directory, and AndroidManifest.xml file of the src directory to the upper layer, so that the sourceSets can find the file by setting the resource path search.

Guess you like

Origin blog.csdn.net/weixin_38515203/article/details/129905840