[Google Analytics Plugin] Error Generating Mobile application after including Google Analytics

Forge Component
(10)
Published on 2 Oct by Experts
10 votes
Published on 2 Oct by Experts

Hi,


After using the Google analytics, my application is failing to generate .


This is the reply from customer support

"

As we previously mentioned, apart from the outdated supported plugin being used by you, the only problem seems to be related to the non-supported “Google Analytics Plugin”. After further analysis on our side, we realized that this plugin is including the following in the “plugin.xml” file:

<framework src="com.google.android.gms:play-services-analytics:+" />

This means, that the plugin will use the most recent version of the “play-services-analytics” library (because the version is defined with “+”). Taking into consideration that Google just updated this and other libraries on June, the 17th, which introduced breaking changes, this means that this plugin is now using version 17.0.0 of that library, which has some requirements that cannot be met by MABS. 


In light of this, one of the ways to overcome this problem, would be to tag a specific version of the “play-services-analytics” library, so the latest one is not used. Indeed, after we defined this library to use version “16.+” (the latest one inside the major version 16), we were able to successfully build your application with the “Google Analytics Plugin”.

"

What should i need to do go further?

Hi Keerthi,

You should follow the Support advice.

You will need to fork the plugin in Github (if it is there), change the XML to tag the correct version of the library (like the Support did), and point the OutSystems plugin to fetch the code from your Github fork instead of the original.

You can also ask the owner of the plugin to perform this action and update the plugin.

Cheers.

Hey Eduardo,


Customer support did an analysis and they sent me the zip file and they asked me to the following procedures.


Following what we mentioned above, we would like to provide you the steps to apply the plugin that we are sending here.

1. Open the “Google Analytics Plugin” component in Service Studio;

2. Go to the “Data” tab in the right panel and upload a new resource – select the attached “google-analytics-plugin.zip”. Leave the “Deploy Action” defined with “Do Nothing”;

3. Go to the “Extensibility Configurations” of the eSpace and replace all its content by:

{
    "resource": "google-analytics-plugin.zip",
    "plugin": {
        "resource": "google-analytics-plugin"
    }
}

4. Publish the “Google Analytics Plugin”;

5. Go to your mobile application's home module and add/refresh the dependencies from the “Google Analytics Plugin”;

6. Publish the mobile application;

7. Generate the application again;


Even after following these procedures i am still getting the error in generation

PFA

After following the procedures of customer support i was able to generate the app with Google Analytics again. 

I noticed that the plugin.xml version that I used has differences to the version that you attached.

I'm attaching the zip that I used.

Best regards.

Hey Leandro,

Thanks for the quick update.

Can you please share your Extensibility Configuration.


I am getting this error after including your file

Keerthi Vasan wrote:

Hey Leandro,

Thanks for the quick update.

Can you please share your Extensibility Configuration.


I am getting this error after including your file

i have changed the name and tried

but got the old error

Keerthi Vasan wrote:

Hey Leandro,

Thanks for the quick update.

Can you please share your Extensibility Configuration.


I am getting this error after including your file

Hi Keerthi,

In order to generate the app you have to republish the plugin itself.

Here are the steps from the customer support:

1. Open “Google Analytics Plugin” in Service Studio;

2. Navigate to “Data” upload a new “Resource” – select the “.zip” attached. Leave “Deploy Action” to “Do Nothing”;

3. Go to “Extensibility Configurations” of the plugin and replace the contents with:

{
    "resource": "google-analytics-plugin.zip",
    "plugin": {
        "resource": "google-analytics-plugin"
    }
}

4. Publish “Google Analytics Plugin”;

5. Go to your “home module” and refresh dependencies;

6. Publish the mobile app in Service Studio;

7. Generate the native app.

Best regards

Hey Leandro,


Thanks. Now I found, I have a different issue.


I tried adding the analytics plugin in a new application.

In that application, I can able to generate successfully.

but in the old app getting the error.

I raised a ticket to customer support. Awaiting for their reply


Thanks,

Keerthi


 

Keerthi Vasan wrote:

Hey Leandro,


Thanks. Now I found, I have a different issue.


I tried adding the analytics plugin in a new application.

In that application, I can able to generate successfully.

but in the old app getting the error.

I raised a ticket to customer support. Awaiting for their reply


Thanks,

Keerthi


 

Hello Keerthi,


I already raised the ticket to the customer support here is their reply:

"

After further analysis on our side, we realized that the cordova plugin, being used by the “Google Analytics Plugin” Component, is including the following in the “plugin.xml” file:

<framework src="com.google.android.gms:play-services-analytics:+" />

This means, that the plugin will use the most recent version of the “play-services-analytics” library (because the version is defined with “+”). Taking into consideration that Google just updated this and other libraries on June, the 17th, which introduced breaking changes in those libraries, this means that this plugin is now using version 17.0.0 of that library, which has some requirements that cannot be met by MABS.

 The same scenario applies for the “play-services-auth” and “play-services-identity” libraries, in the case of the “Google Login Plugin” component. We were able to see that the “plugin.xml” file of the cordova plugin being used by that component includes the following:

    <framework src="com.google.android.gms:play-services-auth:+" />
      <framework src="com.google.android.gms:play-services-identity:+" />

 In light of this, one of the ways to overcome this problem, would be to tag a specific version of those libraries, so the latest one is not used. Indeed, after we defined this library to use version “16.+”.....

"

Meaning you just have to open the .XML file on the plugin zip and edit the framework to:

<framework src="com.google.android.gms:play-services-analytics:16.+" />

I haven´t yet tried on Google Analytics Plugin but i manage to do it in the Google Login Plugin and it generated with no problems at all.


Hope this helps you


Best Regards