[Firebase Mobile] Issue in apk with Firebase Mobile plugin, need to change manifest file configuration
firebase-mobile
Forge component by David Sousa
Application Type
Mobile

Hello,

We are trying to test an app with Firebase Mobile plugin. The contains only a button that should send simple push notification on mobile. I already did the required configuration as per the documentation here  https://www.outsystems.com/forge/Component_Documentation.aspx?ProjectId=4991&ProjectName=firebase-mobile 

For Android, there is an issue with the apk file. After analyzing the apk, we found that value for android:extractNativeLibs is set to false on the App manifest. This value needs to be set to True so that the native libraries can be extracted while installation of the app. This is the documentation on Android Dveeloper site - https://developer.android.com/topic/performance/reduce-apk-size#reduce-binaries. See the snippet below:

 

I could find Outsystems plugins that change other manifest values Permission https://www.outsystems.com/forums/discussion/45641/how-do-i-include-a-permission-in-the-androidmanifest-xml/  and i went through other articles but i don't have background in Android development.  

Is there any simple way to configure the Android manifest file in Outsystems ?

I would appreciate your prompt support.


Thank you

issue was resolved i posted answer on this discussion https://www.outsystems.com/forums/discussion/71814/not-able-to-change-configuration-in-androidmanifest-xml/


seems funny i am posting questions and answering them lol :) 

anyone can help ?

I've watched the Outsystems plugin course and i've created a plugin that should modify  AndroidManifest.xml file and set android:extractNativeLibs attribute value in the <application> element  to true

https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs 

https://www.npmjs.com/package/cordova-custom-config#android-example

This cordova plugin https://www.npmjs.com/package/cordova-custom-config#android-example  does this functionality      

So in my case this how the configuration should be

<custom-preference name="android-manifest/application/@android:extractNativeLibs" value="true" />


Based on the javascript code in their gitHub repository   https://github.com/dpa99c/cordova-custom-config-example/blob/master/spec/android/androidManifestSpec.js 

i used part of the code to make set the android:extractNativeLibs attribute.

Attached is the plugin i created. But i just want to verify that everything is did is correct. 


Anyone can advise. 

AndroidConfigurationApp2.oap

this is the javascript block i used in the plugin attached above


/**

 * Modules

 */

var fs = require('fs');

var path = require('path');

var fileHelper = require(path.resolve('spec/helper/file.js'))();

var xmlHelper = require(path.resolve('spec/helper/xml.js'))();


/**

 * Globals

 */


var manifestPath = fileHelper.getAndroidManifestPath();

var manifest;


if(!manifestPath) return console.warn("Can't find AndroidManifest.xml in platforms/android");

console.log("Running Android manifest spec");

describe("cordova-custom-config android output after 1 prepare operations", function() {

    beforeAll(function(done) {

        fileHelper.restoreOriginalAndroidConfig();

        fileHelper.runCordova('prepare android', function(err, stdout, stderr){

            manifest = fileHelper.parseElementtreeSync(manifestPath);

            done();

        });

    });


    it("should insert application-level attributes", function() {

        xmlHelper.assertXpathExists(manifest, './application/[@android:extractNativeLibs="true"]');

    });


});


describe("cordova-custom-config android output after 2 prepare operations", function() {

    beforeAll(function(done) {

        fileHelper.runCordova('prepare android', function(err, stdout, stderr){

            manifest = fileHelper.parseElementtreeSync(manifestPath);

            done();

        });

    });


    it("should insert application-level attributes", function() {

        xmlHelper.assertXpathExists(manifest, './application/[@android:extractNativeLibs="true"]');

    });


});

issue was resolved i posted answer on this discussion https://www.outsystems.com/forums/discussion/71814/not-able-to-change-configuration-in-androidmanifest-xml/


seems funny i am posting questions and answering them lol :) 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.