Как добавить дополнительный файл Manifest.xml в мою сборку ⇐ Android
-
Anonymous
Как добавить дополнительный файл Manifest.xml в мою сборку
How can I add an additional/extra manifest so that it will be merged eventually with main manifest while building?
app/ ├─ src/ │ ├─ flavor_1/ │ │ ├─ AndroidManifest.xml │ ├─ flavor_2/ │ │ ├─ AndroidManifest.xml │ ├─ flavor_3/ │ │ ├─ AndroidManifest.xml │ ├─ main/ │ │ ├─ AndroidManifest.xml │ ├─ shared_feature/ │ │ ├─ main/ │ │ │ ├─ AndroidManifest.xml //TODO: include this to be merged as well │ │ │ ├─ java/ │ │ │ ├─ res/ Right now my flavor specific AndroidManifest.xml and main AndroidManifest.xml are merged correctly but I want this additional manifest to be merged as well.
All the solutions currently available are stating following solution, But the problem is if I do this, it will override the path for my flavor specific AndroidManifest.xml And I can't afford it, I need all of them.
android { sourceSets { flavor_1 { java.srcDirs += 'src/shared_feature/main/java' res.srcDirs += 'src/shared_feature//main/res' manifest.srcFile = 'src/shared_feature//main/AndroidManifest.xml' } } } But this solution is no good because it replaces the manifest file path for existing flavor specific manifest. It does include the new one, but then omit the flavor specific manifest. And I need both to be included with main.
Источник: https://stackoverflow.com/questions/780 ... o-my-build
How can I add an additional/extra manifest so that it will be merged eventually with main manifest while building?
app/ ├─ src/ │ ├─ flavor_1/ │ │ ├─ AndroidManifest.xml │ ├─ flavor_2/ │ │ ├─ AndroidManifest.xml │ ├─ flavor_3/ │ │ ├─ AndroidManifest.xml │ ├─ main/ │ │ ├─ AndroidManifest.xml │ ├─ shared_feature/ │ │ ├─ main/ │ │ │ ├─ AndroidManifest.xml //TODO: include this to be merged as well │ │ │ ├─ java/ │ │ │ ├─ res/ Right now my flavor specific AndroidManifest.xml and main AndroidManifest.xml are merged correctly but I want this additional manifest to be merged as well.
All the solutions currently available are stating following solution, But the problem is if I do this, it will override the path for my flavor specific AndroidManifest.xml And I can't afford it, I need all of them.
android { sourceSets { flavor_1 { java.srcDirs += 'src/shared_feature/main/java' res.srcDirs += 'src/shared_feature//main/res' manifest.srcFile = 'src/shared_feature//main/AndroidManifest.xml' } } } But this solution is no good because it replaces the manifest file path for existing flavor specific manifest. It does include the new one, but then omit the flavor specific manifest. And I need both to be included with main.
Источник: https://stackoverflow.com/questions/780 ... o-my-build
Мобильная версия