2

I have created a custom plugin for cordova android and I want to use a resource-file. Therefore I have added the following tag to the plugin <resource-file src="src/android/res/values/strings.xml" target="res/values/strings.xml" />

However, this will lead to the following error when building for android:

TypeError: Cannot set property 'text' of null at android_parser.update_from_config (C:\Users\Matthias\AppData\Roaming\npm\ node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parse r.js:209:51) ERROR running one or more of the platforms: TypeError: Cannot set property 'text' of null

The build is succesful when I remove the resource-file tag from plugin.xml. Nevertheless, I need those strings.

Does anyone know any solution or alternative to fix this problem? I found a similar problem here, unfortunately without any solution documented:

phonegap build android; not able to build

Thanks.

Community
  • 1
  • 1
geisi93
  • 31
  • 4

1 Answers1

5

Have you tried setting strings in your plugin.xml like this:

<config-file target="res/values/strings.xml" parent="/*">
    <string name="mystringname">MyStringValue</string>
</config-file>
Igor
  • 51
  • 1