Add2App: Fix crash resulted from hard-code module 'app' based resource copy. (#27154)
This commit is contained in:
@@ -429,8 +429,16 @@ class FlutterPlugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
if (packageAssets) {
|
||||
String mainModuleName = "app"
|
||||
try {
|
||||
String tmpModuleName = project.rootProject.ext.mainModuleName
|
||||
if (tmpModuleName != null && !tmpModuleName.empty) {
|
||||
mainModuleName = tmpModuleName
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
// Only include configurations that exist in parent project.
|
||||
Task mergeAssets = project.tasks.findByPath(":app:merge${variant.name.capitalize()}Assets")
|
||||
Task mergeAssets = project.tasks.findByPath(":${mainModuleName}:merge${variant.name.capitalize()}Assets")
|
||||
if (mergeAssets) {
|
||||
mergeAssets.dependsOn(copyFlutterAssetsTask)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user