Building Cordova application : error: unbound prefix

I am trying to build a Cordova application with cordova-background-geolocation-lt

All was OK without the licence.

Now when I try to use the licence by adding the code below in mobile-config.js, i got error: unbound prefix at > Task :app:mergeReleaseResources stage.

App.appendToConfig(`<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml"> 
<meta-data  android:name="com.transistorsoft.locationmanager.license" android:value="<Your_licence>" ></meta-data>
</config-file>`);

In the config.xml, I have the following and the error underlines the meta-date line:

<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml">
        <meta-data android:name="com.transistorsoft.locationmanager.license" android:value="9a8c4ea5d9de6ffdc49f43d7a4d75e12cc1f4817036a33bd2b47d542a50da15a" />
    </config-file>

In the documentation of the plugin, a namespace must be added as attribute to .

I think the error comes from here but I can’t figure out how to add this attribute to .

Thanks.

I modified directly the builder.js and adding the namespace.
It works!

But it would be better to be able to do it by configuration.

Hey @harry73,

are you aware of this way to configure in your mobile-config.js?

// Example:

App.appendToConfig(`
<platform name="ios">
  <edit-config target="UIStatusBarHidden" file="*-Info.plist" mode="merge">
      <true/>
  </edit-config>
  <edit-config target="UIViewControllerBasedStatusBarAppearance" file="*-Info.plist" mode="merge">
    <false/>
  </edit-config>
  <edit-config target="AllowInlineMediaPlayback" file="*-Info.plist" mode="merge">
      <true/>
    </edit-config>
  <resource-file target="GoogleService-Info.plist" src="../../../cordova-build-override/GoogleService-Info.plist"/>
</platform>
`)

App.appendToConfig(`
<platform name="android">
    <resource-file target="google-services.json" src="../../../cordova-build-override/google-services.json"/>
</platform>
`)

Hi @paulishca,

Perhaps i missunderstood your reply, I already use App.appendToConfig (see above).

My config.xml file looks like that:

?xml version='1.0' encoding='utf-8'?>
<widget id="fr.myana.saseapp" version="0.9.0" xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <feature name="BackgroundFetch">
        <param name="android-package" value="com.transistorsoft.cordova.backgroundfetch.CDVBackgroundFetch" />

...
</widget>

and I do not know how to add namespace (xmlns:android) attribute to the top-level <widget> with App.appendToConfig.

Thanks.

The misunderstanding was totally on my side.

1 Like