cmackay / google-analytics-plugin

Cordova Google Analytics Plugin for Android & iOS
Apache License 2.0
89 stars 43 forks source link

App Build failing since last update #45

Closed writeosahon closed 9 years ago

writeosahon commented 9 years ago

Hello @cmackay Please the update you just released 6 hours ago is preventing Intel XDK from successfully building my app. I have been using this plugin for about a month without issue. I'm building my app using Cordova 4.1.1. I can see that the update to version 0.1.16 says you updated the Android dependency.

Please can you clearly state what was updated or can you reverse the version. Please.

Thank you

UPDATE: I had to use the 0.1.14 release branch. Thank you for keeping this. The 0.1.14 version works well. Please can you kindly investigate the issue with this recent release.

Thanks again

cmackay commented 9 years ago

Hi @writeosahon, This details about the change are in https://github.com/cmackay/google-analytics-plugin/pull/44

Do you get a specific error message? When I was testing the changes in the emulator I had to add the Google Repository and Google Support from the extras section within the Android SDK Manager. Maybe you are seeing a similar issue? Let me know if that is what you are getting for an error.

Thanks,

-Craig

writeosahon commented 9 years ago

Hello Craig. Unfortunately Intel XDK didn't give any details just that it failed to install your plugin. No detailed error message or log was given. The additions you spoke about, were you able to bundle them with the plugin?

Osahon Okungbowa Sent from my Windows Phone

-----Original Message----- From: "Craig MacKay" notifications@github.com Sent: ‎31/‎08/‎2015 02:43 AM To: "cmackay/google-analytics-plugin" google-analytics-plugin@noreply.github.com Cc: "Osahon Okungbowa" writeosahon@yahoo.co.uk Subject: Re: [google-analytics-plugin] App Build failing since last update(#45)

Hi @writeosahon, This details about the change are in #44 Do you get a specific error message? When I was testing the changes in the emulator I had to add the Google Repository and Google Support from the extras section within the Android SDK Manager. Maybe you are seeing a similar issue? Let me know if that is what you are getting for an error. Thanks, -Craig — Reply to this email directly or view it on GitHub.

writeosahon commented 9 years ago

Hello @cmackay . After reading #44 I am beginning to consider some possible reasons for this new build failure. 1st, what is the Minimum Android SDK supported by the new framework used in place of Google Play Services. Currently, my app supports sdk 12+ (i.e. 12 - 22).

2nd, what Cordova CLI Version are you using to build your work. Currently I use Version 4.1.2. Maybe you are using a higher CLI version (i.e. 4.2+ / 5.1.1). Please read https://software.intel.com/en-us/forums/topic/564234 for some more info on this.

Hope this helps. Thanks for all the work on this plugin.

cmackay commented 9 years ago

I am not sure what the min android sdk supported by the new framework is.

As for the cordova CLI version I am running, it is 5.2.0. Not really sure what the issue is that you are having. It might be good to see if there is any way you can get more info on the problem you have. Is there any sort of debug logging you can enable. Having some error details would help in troubleshooting this.

I am sorry I can not provide more help with your question. If I have time I can try to get the intel xdk and see if I can reproduce it. I am not sure when I will be able to dig into this in more detail so until then I recommend you use the 0.1.14 version. Please let me know if you can get any error details.

Thanks,

-Craig

petarov commented 9 years ago

The minimum required android sdk version seems to be Android 2.3 (API level 9). As for Cordova CLI, I think it probably isn't an issue, because both the framework tag and Gradle build system are available since v4.0.0.

I believe the problem is just as @cmackay already described above:

I had to add the Google Repository and Google Support from the extras section within the Android SDK Manager

@writeosahon Have you already tried this?

cmackay commented 9 years ago

Hi @writeosahon, I have done some more testing including trying out the Intel XDK. I was able to deploy a test app using the latest plugin in the XDK without any error. The emulation mode that I had seen didn't seem to run native plugins though. I did however install a clean instance of the android sdk, with a new test app using the latest plugin. Like before and as @petarov mentioned, two additional packages are required to use the native analytics services, "Android Support Repository" and "Google Repository". After adding the packages and deploying a test app, I was able to see analytics views registering with the analytics real time view. Hopefully adding these packages will resolve your issue. Attached is a screenshot of the required emulator packages. Let me know how it works out.

packages

writeosahon commented 9 years ago

@cmackay @petarov Thanks for responding. Thanks so much for the screenshots and detailed explanations. Let me explain a little of my development cycle: I do all my development using javascript and cordova plugins. I do not have any Andriod SDK installed on my system. When I need to build my app, I build it in the cloud (e.g. IntelXDK Build or PhoneGap Build). Now, for someone like me that builds apps in the cloud and doesn't use the Android SDK, How do I include the required Android libraries? Here is a suggestion on how to ensure the new version of the plugin is cloud-friendly (i.e. works with Phonegap Build, IntelXDK Build and Telerik AppBuilder). Please, include/package the Android Support Repository & Google Repository jar files directly into your plugin. That is, place a local copy of the jar files in a location that your plugin references. See these links http://stackoverflow.com/questions/25438160/how-do-i-properly-include-an-external-jar-file-for-a-cordova-plugin ; http://stackoverflow.com/questions/31341904/how-to-include-jar-files-in-phonegap-android-application ; http://stackoverflow.com/questions/31147128/using-jar-file-with-phonegap-cordova-plugin . With this, the required files will be incorporated into the plugin and your plugin will work well with Cordova Cloud Build Services. Hope these details help you to ensure the plugin work well with Cloud-Build Services.

Looking forward to using the latest version of your plugin in my updated apps. Thanks for taking out time to respond and address this issue. Please let me know how you progress.

cmackay commented 9 years ago

This is a plugin for cordova and phonegap builds and it follows the recommend approaches for including google play services. The approach of not including the common platform related dependencies is by design and the best practice. Otherwise many apps would include all these standard dependencies like google play services. I appreciate your suggestions but I will not be importing the dependency jars into the build. At one point this project had the native dependencies and when the native analytics was moved into google play services they were removed.

When I created an app to test out the build, I do the following:

cordova create analytics-test cd analytics-test cordova platform add android cordova plugin add com.cmackay.plugins.googleanalytics // edit the www/js/index.js to actually use the plugin (register tracking code/ send an analytics request) cordova run android

I also then was able to open this project in the XDX and hit build on it and it sent me an email saying the cloud build was successful. I would like it to work with all cloud build services but it is really the responsibility of the clould build providers that support cordova to ensure that cordova dependencies are imported properly. As far as I know everything is working fine on Intel XDX since I have not seen any errors in my testing.

If you can provide more details on what is not working, I may look into this in more but for now I am closing this since everything appears to be working properly. I appreciate the information you have provided but I am not able to reproduce any error.

Thanks,

-Craig

petarov commented 9 years ago

Just to add. I believe PhoneGap builds (at least older versions) may have some general error working with the framework tag. A similar issue, reported here, seems to exist at the admob plugin side.

@writeosahon I don't have experience with PG, but maybe it is due to an older PG build version and maybe it is fixed with PG Cordova Build 5.1.1 already. You should check with the PG guys for more info on this, as it is in their domain of responsibility as @cmackay noted.

writeosahon commented 9 years ago

@petarov @cmackay Thanks for the detailed links and explanations. I have been away, hence the late response. You are absolutely right. The Intel XDK has a problem with resolving gradle builds with libraries/resources from Google. Right now, XDK checks the maven central repo when trying to resolve resources. Unfortunately, Google does not house its libraries in any of those repos. I'll log an issue with the XDK folks on Monday, this needs to be addressed since the framework tag is the recommended way to create plugins. I'll keep you updated once the issue is resolved. I'm sure other users would like to know how this can be solved.

Thanks for everything. Enjoy the weekend