I'am trying to add Google Analytics to my application
I've followed every step at this page
https://developers.google.com/analytics/devguides/collection/android/v4/#tracking-methods
the issue is Eclipse not recognized Tracker and GoogleAnalytics
the Google play service and every thing are installed from SDK
I've tried to search for V4 Analytics SDK i could't find it
i don't know if i mess something here
any advice ?
Finally found the solution ..
Google Analytics V4 has no SDK , its depends on Google Play Services SDK
So here is what i did :
download Google Play Services SDK from Android SDK
go to Android SDK folder on you PC partition
Follow this path (/extras/google/google_play_services/libproject/ )
you'll find this folder ( google-play-services_lib ) <- thats what we need
now go to Eclipse and import this Project ( google-play-services_lib ) as Library
right click on your project Properties -> Android -> Second Tab ( Library ) Click Add and select google-play-services_lib
Now you've done you can use Google Analytics V4 with no problems at all
The Idea is you need to download and import Google Play Services to Eclipse then add the library to your project .
enjoy coding ..
In Android Studio you need to add the google play services as dependency to gradle. For example:
compile 'com.google.android.gms:play-services:6.5.87'
After that click the Sync Project with Gradle Files icon and it should work.
Related
I just added OneSignal to my Cordova project. This appears to use Google Play services i.e. (I get a message "No valid Google Play services APK found"). I was wondering the best approach for adding it.
I have Google Play services v8.4.89 installed on my phone.
I have Google Play services installed via the SDK manager:
This creates a google_play_services folder (without a lot in it):
UPDATE
As per this Google has broken down Google Play Services into multiple libraries (.aar) located at:
android-sdk\extras\google\m2repository\com\google\android\gms
build.gradle dependencies:
I'm a little unsure of what to do next. I thought I could have potentially used this.
I might add I am using IntelliJ and have tried to import the JAR manually as per this.
Thanks,
The OneSignal error "No valid Google Play services APK found" means that the "Google Play services" app is missing from the device or is most likely just out of date. It should check the version under Settings>Apps. It should update automatically in the background after you open the Google Play store on the device and sign in. See the following link for more details.
https://documentation.onesignal.com/docs/all-users-are-shown-as-not-subscribed
You need to add it to your project library..
File >> Import, select Android > Existing Android Code into Workspace, browse to the library project (your android sdk env) to import it. extras/google/google_play_services/
After this.. you need to open the properties for your project..
Right click on your project and click properties select android and under the library section add the google lib.
I have installed google play services from sdk manager in eclipse, however, when I go to project properties -> android tab there is no library to add all I've got is ..\appcompat_v7
Can you please help
Could you check that you imported the library onto the same physical drive as your project? This is a common mistake and as far as I know official documentation doesn't mention it.
I'm trying to integrate Google Analytics in my Unity game. I've downloaded and installed the latest unitypackage.
In Unity after clicking on Google Analytics > Setup > Install google-play-services_lib I get this error:
I've installed Google Play Services in Android SDK manager but it does not install the lib. Even the description of the package says it only installs JavaDoc and Sample code, no library:
So the problem is that in the /extras/google/google_play_services/ folder there is no libproject subfolder at all. Only JavaDoc and Samples folders.
I've read the documentation (tab OTHER because I'm not using neither Android Studio nor Eclipse), followed the instructions step by step and it just doesn't work. And my googling turned in vain. How can I install google play services lib?
Have you tried checking the Setting Up Google Play Services Document by Google?
For Android Studio:
Open the build.gradle file inside your application module directory.
Add a new build rule under dependencies for the latest version of play-services. For example:
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services:fp9.0.0'
}
Save the changes and click Sync Project with Gradle Files in the toolbar.
Note: If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them. For information on how to do this, see Selectively compiling APIs into your executable.
For Eclipse with ADT:
Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects.
Import the library project into your Eclipse workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
In your app project, reference Google Play services library project. See Referencing a Library Project for Eclipse for more information on how to do this.
After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the <application> element:
I am desperately trying to integrate GA v4 in my Android app.
And I followed the guide here https://developers.google.com/analytics/devguides/collection/android/v4/
And integrated Google Play Services lib as described, but it gives me
Could not find class 'com.google.android.gms.analytics.Tracker
But I can find classes and its namespaces in the project.
I can't figure out what's happening here.
I followed also the instruction on Analytics for Android v4.
But additionally I had to update play services and build tools in the SDK manager. Then I had to add compile 'com.google.android.gms:play-services:8.4.0' in the app build.gradle (above of compile 'com.google.android.gms:play-services-analytics:8.4.0'. The Tracker class was still unknown (red underlined) but despite of that I pressed "Run" (install app) in Android Studio and only then analytics was recognized and could be used.
I had the same problem and the reason was my Google Play services package was outdated.
Using Eclipse, I went into Window > Android SDK Manager, checked only Google Play services package (under "Extras" in the bottom), updated it and created a new lib project.
Then I followed the steps in tutorial below to create a new google play services lib project.
https://developer.android.com/google/play-services/setup.html
Hope it helps!
/Paulo
I just imported an example of the google map api V2 for android to test. It's missing the google-play-services_lib.jar. I can't find this library. Where do I get it?
First check that your sdk contains Google Play Services installed or not.
For that you do the below steps
In Eclipse--->Window--->Android SDK MAnager--->Check Google Play
Services installed in extras.
Then you add the google plays services jar by find that one at the below location
your-android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs
If you do the above and it is still not working because it cant access the temp folder you
can go to your SDK manager in your android sdk directory and run it as an administrator
Right-click on your google-play-services_lib project -> Build Project
Right-click on your project using the google-play-services_lib -> Build Project