@@ -39,6 +39,8 @@ def configStage = "\n:config phase: "
3939def nodeModulesDir = " ../../node_modules/"
4040def pluginNames = new ArrayList<String > ()
4141def configDir = file(configurationsDir)
42+ def appResExists = false
43+ def appResourcesName = " NativescriptAppResources"
4244
4345def compiteCompileSdkVersion () {
4446 if (project. hasProperty(" compileSdk" )) {
@@ -216,6 +218,10 @@ task createDefaultIncludeFiles {
216218 createPluginConfigFile = true
217219 def foundIncludeFile = false
218220
221+ if (fileName == appResourcesName) {
222+ appResExists = true
223+ }
224+
219225 println " \t +found plugins: " + fileName
220226 fl. listFiles(). each { subFile ->
221227
@@ -225,7 +231,9 @@ task createDefaultIncludeFiles {
225231 }
226232 }
227233
228- pluginNames. add(' "' + dimensionName + ' "' )
234+ if (! appResExists) {
235+ pluginNames. add(' "' + dimensionName + ' "' )
236+ }
229237
230238 if (! foundIncludeFile) {
231239 createIncludeFile(fl. getAbsolutePath() ,fileName, dimensionName)
@@ -246,6 +254,9 @@ task createPluginsConfigFile {
246254 if (createPluginConfigFile) {
247255 println " \t +creating product flavors include.gradle file in $configurationsDir folder..."
248256 def flavors = pluginNames. join(" ," )
257+ if (appResExists) {
258+ flavors = ' "' + appResourcesName + ' ", ' + flavors
259+ }
249260 flavorsFile << " android { \n "
250261 flavorsFile << " \t flavorDimensions " + flavors + " \n "
251262 flavorsFile << " }\n "
0 commit comments