Cordova-plugin-firebase: after_prepare.js broken PLATFORM.ANDROID.stringsXml

Created on 24 Jan 2018  路  8Comments  路  Source: arnesson/cordova-plugin-firebase

Error on line 52.20 from file after_prepare.js
The folder path to compile looks like it has changed in Cordova-android 7.0 for
'app \ src \ main \ res \ values' error occurred while generating PLATFORM.ANDROID.stringsXml

Most helpful comment

Changing this line
stringsXml: ANDROID_DIR + '/res/values/strings.xml'
to
stringsXml: ANDROID_DIR + '/app/src/main/res/values/strings.xml'

will fix the issue. There should be a check on the cordova android version so the path can be set accordingly as indeed the folder structure is changed as of 7.0.0:
https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

All 8 comments

Same problem here

Same problem!

For now, in my case, I decided to adjust the version of Android to 6.3.0

ionic cordova platform add [email protected]

This version did not have this problem.

The downgrade also works for me.

Changing this line
stringsXml: ANDROID_DIR + '/res/values/strings.xml'
to
stringsXml: ANDROID_DIR + '/app/src/main/res/values/strings.xml'

will fix the issue. There should be a check on the cordova android version so the path can be set accordingly as indeed the folder structure is changed as of 7.0.0:
https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

@m6246 where to change
exact file path?

Changing this line
stringsXml: ANDROID_DIR + '/res/values/strings.xml'
to
stringsXml: ANDROID_DIR + '/app/src/main/res/values/strings.xml'

Please check out this pull request - https://github.com/arnesson/cordova-plugin-firebase/pull/570 It contains the fix to install the plugin for cordova android 7.0.0

Trying to fix this in commit 039e29e. please test!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ulisesvera picture ulisesvera  路  5Comments

jdla1990 picture jdla1990  路  4Comments

rlz picture rlz  路  4Comments

matthitachi picture matthitachi  路  5Comments

Zrnik picture Zrnik  路  3Comments