Android : Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker - android

I have an app that makes use of the Google Analytics library. I recently moved the code into a new workspace and the app has stopped working. The code builds OK but when it runs it halts with the following error.
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker, referenced from method com.apps4care.v2conf.utils.analytics.raiseEvent
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7179: Lcom/google/analytics/tracking/android/EasyTracker;.getTracker ()Lcom/google/analytics/tracking/android/Tracker;
06-12 23:11:14.117: D/dalvikvm(31080): VFY: replacing opcode 0x71 at 0x0021
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.apps4care.v2conf.utils.analytics.start
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7178: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance ()Lcom/google/analytics/tracking/android/EasyTracker;
06-12 23:11:14.117: D/dalvikvm(31080): VFY: replacing opcode 0x71 at 0x0000
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.apps4care.v2conf.utils.analytics.stop
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7178: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance ()Lcom/google/analytics/tracking/android/EasyTracker;
The analytics JAR is in my "libs" folder and I can see it listed in the "Libraries" tab on the Java Build Path within Properties.
Any clues how I can fix this....

I'm assuming you're in Eclipse.
Right click on your project, select Properties.
Under Java Build Path, click on Order & Export tab.
Check Android Private Libraries and click OK.

Related

GooglePlayServices not working

I am currently trying to get GooglePlayServices working, but I have no idea why it doesn't. In the manifest there is the permission in the application context:
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
However, every time I try to check if GooglePlayServices is connected, it returns a false and below is the message in the logcat:
I/dalvikvm(8477): Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh
W/dalvikvm(8477): VFY: unable to resolve virtual method 612: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
D/dalvikvm(8477): VFY: replacing opcode 0x6e at 0x000b
The target properties of GPS is 4.4.2.
If you have more questions just comment.
This must be a bug described here:
Issue 91424: Bug introduced with 'com.android.support:appcompat-v7:21.0.3'
update the support library to 22.1.0 or later!

Unable to resolve superclass of Lcom/worklight/androidgap/WLDroidGap

When I play with Getting Started exercise "Using Worklight API in native Android applications", I get failed to connect to worklight server from native Android page, and error messages below:
Unable to resolve superclass of Lcom/worklight/androidgap/WLDroidGap; (435)
Link of class 'Lcom/worklight/androidgap/WLDroidGap;' failed
Could not find method com.worklight.androidgap.WLDroidGap.getWLConfig,
referenced from method com.worklight.common.WLUtils.checkIfMediaFile
VFY: unable to resolve static method 253: Lcom/worklight/androidgap/WLDroidGap;
.getWLConfig ()Lcom/worklight/common/WLConfig;
VFY: replacing opcode 0x71 at 0x0001
Unable to resolve superclass of Lcom/worklight/androidgap/WLDroidGap; (435)
Link of class 'Lcom/worklight/androidgap/WLDroidGap;' failed
Could not find method com.worklight.androidgap.WLDroidGap.getWLConfig,
referenced from method com.worklight.common.WLUtils.computeChecksumOnResources
VFY: unable to resolve static method 253: Lcom/worklight/androidgap/WLDroidGap;
.getWLConfig ()Lcom/worklight/common/WLConfig;
VFY: replacing opcode 0x71 at 0x0021
Unable to resolve superclass of Lcom/worklight/androidgap/WLDroidGap; (435)
Link of class 'Lcom/worklight/androidgap/WLDroidGap;' failed
VFY: unable to find class referenced in signature (Lcom/worklight/androidgap/WLDroidGap;)
Unable to resolve superclass of Lcom/worklight/androidgap/WLDroidGap; (435)
Link of class 'Lcom/worklight/androidgap/WLDroidGap;' failed
Could not find method com.worklight.androidgap.WLDroidGap.getLocalStorageWebRoot,
referenced from method com.worklight.common.WLUtils.findDrawableAsset
unable to resolve virtual method 248: Lcom/worklight/androidgap/WLDroidGap;
.getLocalStorageWebRoot ()Ljava/lang/String;
VFY: replacing opcode 0x6e at 0x0007
Skipped 31 frames! The application may be doing too much work on its main thread.
Environment information:
Operation System: Windows 7, 64 bit
Java: Oracle, 1.6.0_45, 64 bit
Installation type: Developer Edition
Eclipse: Java EE, Juno SR2
Worklight plug-in : 5.0.6.20130311
Environment details: Android, 4.2.2, API level 17, emulator
right-clicking on the Android project, choosing properties, Java Build Path, and Checking the Android Private Libraries under Order and Export
This problem can also be due two version of android-support-v4.jar in the dependency list,
delete android-support-v4.jar from your project libs folder. now clean and build your project and run.

An error occurred after update the Android SDK Tool REV 22 "Unable to resolve superclass of L"

The project is good yesterday, but when I update Sdk tools and ADT today(REV 22), the error occurred like "Unable to resolve superclass of L..." when I run the project.
My project uses ActionbarSherlock and SlidingMenu.
I have already tried:
Copy external jars to my project's "libs" folder. (I have already do this before)
Properties->Java Build Path->Projects and add the library project there.
clean and rebuild
reset the computer or IDE
Try other project which also contains project lib
Follow Class not found error after updating ADT and Android sdk tools to latest ver 22
But they are all failed.
The whole Logcat is below:
05-17 06:53:50.087: E/Trace(949): error opening trace file: No such file or directory (2)
05-17 06:53:50.188: W/dalvikvm(949): Unable to resolve superclass of Lcom/qdnews/utils/AsyncImageLoaderX$1; (50)
05-17 06:53:50.197: W/dalvikvm(949): Link of class 'Lcom/qdnews/utils/AsyncImageLoaderX$1;' failed
05-17 06:53:50.197: E/dalvikvm(949): Could not find class 'com.qdnews.utils.AsyncImageLoaderX$1', referenced from method com.qdnews.utils.AsyncImageLoaderX.<init>
05-17 06:53:50.207: W/dalvikvm(949): VFY: unable to resolve new-instance 177 (Lcom/qdnews/utils/AsyncImageLoaderX$1;) in Lcom/qdnews/utils/AsyncImageLoaderX;
05-17 06:53:50.207: D/dalvikvm(949): VFY: replacing opcode 0x22 at 0x001b
05-17 06:53:50.207: I/dalvikvm(949): Could not find method android.support.v4.util.LruCache.put, referenced from method com.qdnews.utils.AsyncImageLoaderX.addBitmapToCache
05-17 06:53:50.207: W/dalvikvm(949): VFY: unable to resolve virtual method 112: Landroid/support/v4/util/LruCache;.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
05-17 06:53:50.217: D/dalvikvm(949): VFY: replacing opcode 0x6e at 0x0007
05-17 06:53:50.237: I/dalvikvm(949): Could not find method android.support.v4.util.LruCache.get, referenced from method com.qdnews.utils.AsyncImageLoaderX.getBitmapFromCache
05-17 06:53:50.237: W/dalvikvm(949): VFY: unable to resolve virtual method 111: Landroid/support/v4/util/LruCache;.get (Ljava/lang/Object;)Ljava/lang/Object;
05-17 06:53:50.237: D/dalvikvm(949): VFY: replacing opcode 0x6e at 0x0005
05-17 06:53:50.257: W/dalvikvm(949): Unable to resolve superclass of Lcom/qdnews/utils/AsyncImageLoaderX$1; (50)
05-17 06:53:50.257: W/dalvikvm(949): Link of class 'Lcom/qdnews/utils/AsyncImageLoaderX$1;' failed
05-17 06:53:50.267: D/dalvikvm(949): DexOpt: unable to opt direct call 0x025a at 0x1d in Lcom/qdnews/utils/AsyncImageLoaderX;.<init>
05-17 06:53:50.277: D/AndroidRuntime(949): Shutting down VM
With rev 22, they added "Android Private Libraries".
For every related Project (including the actionbarsherlock project), right click it -> Properties -> Java Build Path -> Order and Export -> Check Android Private Libraries
Besides adding Android Private Libraries, that should be also related to the target SDK version.
Try set 'android:targetSdkVersion="17"' in the manifest XML, this solve my build problem recently after updating the SDK
After adding Android Private Libraries, I had the problem with
... Unable to execute dex: Multiple dex files define ...
... Conversion to Dalvik format failed: Unable to execute dex: Multiple dex ...
After deleting all libs except for "Android 4.2", "Android Dependencies" and "Android Private Libraries" the problem was solved and I could export my app.
I encounter the same problem when I update ADT and SDKTools for 22 ,and I trid all answer that I can find from internet,but it doesn't work ,at last ,try set 'android:targetSdkVerson="17"' in the project.properties,and clean it ,then problem solved.

android backup agent and SherlockMapActivity

I try to implement a Backup Agent in my Android app, and I've got a weird issue every times it restore (at first launch) :
Unable to resolve superclass of Lcom/actionbarsherlock/app/SherlockMapActivity; (916)
Link of class 'Lcom/actionbarsherlock/app/SherlockMapActivity;' failed
Unable to resolve superclass of Lnet/myapp/activity/impl/MapActivity; (674)
Link of class 'Lnet/myapp/activity/impl/MapActivity;' failed
Could not find class 'net.myapp.activity.impl.MapActivity', referenced from method net.myapp.helper.SlidingMenuHelper.<clinit>
VFY: unable to resolve const-class 1520 (Lnet/myapp/activity/impl/MapActivity;) in Lnet/myapp/helper/SlidingMenuHelper;
VFY: replacing opcode 0x1c at 0x0081
Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lnet/myapp/helper/SlidingMenuHelper;
Complete log here : https://gist.github.com/romainguefveneu/1acc78cabbed65fba4b7
The restore process works just fine, when I open a second time the app, my data are correctly restored.
It seems to be an issue with the loading of SherlockMapActivity, I use all those libs in my project :
actionbarsherlock-plugin-maps-4.2.0.jar
bugsense-3.0.1.jar
commons-io-2.0.1.jar
gson-2.2.2.jar
joda-time-2.1.jar
ocpsoft-pretty-time-1.0.7.jar
Does someone has an idea ?

Android + Zip4j-1.3.1 jar throws VerifyError

I am trying to use the zip4j jar file in my android project to password protect the zip file in the application. Copied the jar in lib folder & added it to build path. The code compiles fine. But when I run the project it gives VerifyError.
NOTE: It works fine if I added the source code to the project instead of the jar.
E/dalvikvm(1502): Could not find class 'net.lingala.zip4j.core.ZipFile', referenced from method a.test.zip.ZipHelper.zipFilesWithStandardZipEncryption
W/dalvikvm(1502): VFY: unable to resolve new-instance 45 (Lnet/lingala/zip4j/core/ZipFile;) in La/test/zip/ZipHelper;
D/dalvikvm(1502): VFY: replacing opcode 0x22 at 0x002a
W/dalvikvm(1502): VFY: unable to resolve exception class 46 (Lnet/lingala/zip4j/exception/ZipException;)
W/dalvikvm(1502): VFY: unable to find exception handler at addr 0x78
W/dalvikvm(1502): VFY: rejected La/test/zip/ZipHelper;.zipFilesWithStandardZipEncryption (Landroid/content/Context;)V
W/dalvikvm(1502): VFY: rejecting opcode 0x0d at 0x0078
W/dalvikvm(1502): VFY: rejected La/test/zip/ZipHelper;.zipFilesWithStandardZipEncryption (Landroid/content/Context;)V
W/dalvikvm(1502): Verifier rejected class La/test/zip/ZipHelper;
D/AndroidRuntime(1502): Shutting down VM
W/dalvikvm(1502): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
where did you put your jar file?
not necessary, but in some cases it works as follows: you need to put your jar in assets folder. then you configure your Java builtpath. add the jar from assets folder, then (in eclipse, get to order and export tab and check the jar file) export the jar.
it automatically adds it into your applications lib folder. i don't know why but it didn't work the other way around (coppying the jar in lib and adding it to builtpath) in one of my applications.
you can also change your java compiler.

Categories

Resources