I have a working android app and now want to add google analytics to it. I am following the instructions here:
http://code.google.com/mobile/analytics/docs/android/
When I add the import statement:
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
I get the error:
The import com.google.android cannot be resolved
I have created a libs directory in the project and placed the libGoogleAnalytics.jar file in it. I tried adding this to the AndroidManifest.xml:
<uses-library android:name="com.google.android.analytics" />
I have tried opening and closing Eclipse and doing 'Project / Clean'. Nothing seems to affect the problem. I am somewhat new to Java. What am I missing?
I think you should add library libGoogleAnalytics.jar to build path (in libs right click on libGoogleAnalytics.jar -> BuildPAth -> Add to Build Path) Do not add anything in Manifest file and in your java file use cmd+Shift+O(for Mac, for Windows Ctrl+Shift+O) to automatically organize your imports)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With