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!
Related
I came back to work today and I started debugging my app using the emulator (KitKat), and my app runs ok. I had made some changes since last Friday, but not much.
Then I moved to the device (Gingerbread) and notices the app, that was working last week, had started to crash right on main activity's setContentView(). Here are the warning/error messages:
W/ActivityThread﹕ Application com.example.myapp is waiting for the debugger on port 8100...
W/dalvikvm﹕ VFY: unable to resolve static method 790: Landroid/net/TrafficStats;.setThreadStatsTag (I)V
W/dalvikvm﹕ VFY: unable to resolve instance field 50
W/dalvikvm﹕ VFY: unable to resolve virtual method 95: Landroid/app/Activity;.getFragmentManager ()Landroid/app/FragmentManager;
W/dalvikvm﹕ Unable to resolve superclass of Lmaps/aj/r; (671)
W/dalvikvm﹕ Link of class 'Lmaps/aj/r;' failed
W/dalvikvm﹕ Unable to resolve superclass of Lmaps/ay/an; (6382)
W/dalvikvm﹕ Link of class 'Lmaps/ay/an;' failed
W/dalvikvm﹕ Unable to resolve superclass of Lmaps/c/i; (6613)
W/dalvikvm﹕ Link of class 'Lmaps/c/i;' failed
E/dalvikvm﹕ Could not find class 'maps.c.i', referenced from method maps.e.al.a
W/dalvikvm﹕ VFY: unable to resolve new-instance 6818 (Lmaps/c/i;) in Lmaps/e/al;
All these messages appear after the setContentView method.
I noticed that it mentions getFragmentManager, however that's not part of my app. Since it has API 9 compatibility, I'm using the AppCompat v7, getSupportFragmentManager and including the Supporteverywhere it is needed.
I've undone the changes I did earlier today, but it still doesn't work.
Is it possible that the appcompat lib was updated recently? I'm using Gradle to get most of them:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:+#aar'
compile 'com.google.code.gson:gson:+#jar'
compile 'com.google.zxing:android-integration:+#jar'
compile 'com.googlecode.libphonenumber:libphonenumber:+#jar'
compile 'com.intellij:annotations:12.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':Facebook')
}
I don't know how to debug these VFY errors. What can I do to try to solve them?
I don't know how to debug these VFY errors
They are not errors. They are warnings. The "W" in the beginning of each line is short for "warning".
Those warnings are merely noting classes, methods, and other symbols that Dalvik saw when loading classes from your APK that it could not resolve. So long as you do not actually execute any code that contains any of that missing stuff, everything will be fine. Moreover, they are largely unavoidable, as they are a natural side-effect of application and library code using newer capabilities on newer devices where those capabilities are supported.
Why can't the dalvikvm find method android.content.pm.ApplicationInfo.loadLogo ?
08-15 15:19:45.112: D/dalvikvm(319): VFY: replacing opcode 0x6e at 0x008b
08-15 15:19:45.112: I/dalvikvm(319): Could not find method android.content.pm.ApplicationInfo.loadLogo,
referenced from method android.support.v7.internal.widget.ActionBarView.<init>
08-15 15:19:45.112: W/dalvikvm(319): VFY: unable to resolve virtual method 417:Landroid/content/pm/ApplicationInfo;
.loadLogo (Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
Someone here posted a problem with this on a different site. His solution was:
Got it. Found no applied style which causes my problem but found a workaround for this...
Directly after applying the style via setTheme(R.style.Theme_Sherlock);
i'm using the following code to set the background color.
View v = act.getWindow().getDecorView();
if (v != null){
v.setBackgroundColor(R.color.abs__background_holo_dark);
}
Now everything is working like expected.
loadLogo() is new to API Level 9. If you are running this on API Level 8 or below, you will get this warning.
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.
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.
Everything was working fine in my app. Then, I did a small refactoring and a key component stopped working. When I looked at the LogCat output, this is what I found:
WARN/dalvikvm(488): VFY: unable to resolve virtual method 10830: Ljava/lang/String;.getBytes (Ljava/nio/charset/Charset;)[B
DEBUG/dalvikvm(488): VFY: replacing opcode 0x6e at 0x000e
DEBUG/dalvikvm(488): VFY: dead code 0x0011-0015 in Lcom/appiancorp/tempo/android/service/CommentXmlHttpMessageConverter;.writeInternal (Lcom/appiancorp/tempo/android/model/EntryComment;Lorg/springframework/http/HttpOutputMessage;)V
This was ... surprising, to say the least. I looked at the documentation and the method is there, what gives?
The getBytes(Charset) exists in API9 and later. Make sure you are building against this version of the SDK or use the getBytes(String charsetName) which exists in API1.
You can also you the "filter by API level" checkbox in online SDK documentation to gray out methods not available in the version you are building against.