VerifyError Eclipse "warning: method is huge" - android

I'm running a program in Eclipse that involves doing a bit of math and database inputting. At one point it seems to be too much because Eclipse gives me a VerifyError. When I delete a little bit it runs fine, doesn't matter what I delete so it's not a specific part causing the error but the length of it all, it seems. Here's the error message:
10-27 17:04:03.855: W/dalvikvm(12618): VFY: warning: method is huge (regs=643 insnsSize=7090)
10-27 17:04:03.855: W/dalvikvm(12618): VFY: rejected Lcom/example/simpledatabasetutorial/DatabaseManageActivity;.onClick (Landroid/view/View;)V
10-27 17:04:04.114: W/dalvikvm(12618): VFY: register2 v12-13 values 0,0
10-27 17:04:04.114: W/dalvikvm(12618): VFY: rejecting opcode 0xab at 0x10f2
10-27 17:04:04.114: W/dalvikvm(12618): VFY: rejected Lcom/example/simpledatabasetutorial/DatabaseManageActivity;.onClick (Landroid/view/View;)V
10-27 17:04:04.114: W/dalvikvm(12618): Verifier rejected class Lcom/example/simpledatabasetutorial/DatabaseManageActivity;
10-27 17:04:04.114: W/dalvikvm(12618): Class init failed in newInstance call (Lcom/example/simpledatabasetutorial/DatabaseManageActivity;)
10-27 17:04:04.114: D/AndroidRuntime(12618): Shutting down VM
10-27 17:04:04.114: W/dalvikvm(12618): threadid=1: thread exiting with uncaught exception (group=0x40015560)
10-27 17:04:04.145: E/AndroidRuntime(12618): FATAL EXCEPTION: main
10-27 17:04:04.145: E/AndroidRuntime(12618): java.lang.VerifyError: com.example.simpledatabasetutorial.DatabaseManageActivity
Any ideas of a quick solution? Maybe this is far from enough info, if that's the case just let me know and I'll include what ever is relevant.

The problem isn't actually that your method is too large. As of gingerbread, excessively-large methods no longer cause the method to be rejected. (The first "rejected" message just appears because it's using the LOG_VFY_METH macro to report the method name.)
The real problem is the second complaint, register2 v12-13 values 0,0 ... rejecting opcode 0xab. 0xab is an "add-double" instruction, which takes a 64-bit argument, which means the types on the two 32-bit Dalvik registers should be "double low" and "double high". The verifier found that they're both type zero, which is "unknown".
So either there's a bug in the Dalvik verifier or there's a bug in the generated code (possibly originating in the "dx" tool). You should file a report on http://b.android.com/.

Related

Current AndroidStudio sample fails on phone due to runtime native library link error. Why?

Its on an HTC Aria, running 2.2 (API 8)
https://en.wikipedia.org/wiki/HTC_Aria
The aria is an armv6 device that supports opengles 2
If you open up the latest Android Studio (im working on windows 7), then import the HelloGL2 sample, then simply try to run it on the above device, it will fail as soon as it tries to make a call into the native library.
Here is the log:
01-06 11:14:08.467 12771-12813/com.android.gl2jni D/dalvikvm: Trying to load lib /data/data/com.android.gl2jni/lib/libgl2jni.so 0x44c165d0
01-06 11:14:08.467 12771-12813/com.android.gl2jni I/dalvikvm: Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so
01-06 11:14:08.477 12771-12813/com.android.gl2jni W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/android/gl2jni/GL2JNILib;.<clinit>
01-06 11:14:08.497 12771-12813/com.android.gl2jni W/dalvikvm: threadid=8: thread exiting with uncaught exception (group=0x40028a00)
01-06 11:14:08.517 95-121/? I/ActivityManager: Displayed activity com.android.gl2jni/.GL2JNIActivity: 9823 ms (total 2027818 ms)
01-06 11:14:08.567 12771-12813/com.android.gl2jni E/AndroidRuntime: FATAL EXCEPTION: GLThread 9
java.lang.ExceptionInInitializerError
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
Caused by: java.lang.UnsatisfiedLinkError: Library gl2jni not found
at java.lang.Runtime.loadLibrary(Runtime.java:461)
at java.lang.System.loadLibrary(System.java:557)
at com.android.gl2jni.GL2JNILib.<clinit>(GL2JNILib.java:24)
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332) 
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327) 
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118) 
01-06 11:14:08.607 95-164/? W/ActivityManager: Force finishing activity com.android.gl2jni/.GL2JNIActivity
This sample works on the 3 other devices i've tried (Galaxy s5, Galaxy J1, Nexus s)
The line: 'Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so' is probably key. I tried loading the library explicitly using system.loadlibrary, but the same problem happens on that call.
I think it might be something to do with the processor being armv6?
The sample is configured to do 'armeabi' though.

When ran an application in Genymotion i get: "Unfortunately, app has stopped."

I'm looking for a good option to automate my tests in a mobile application. Genymotion looks the best option.
So i installed genymotion, added the arm translation and gapps in the vm, but when i try to open my application i get: "Unfortunately, [app name] has stopped."
Applications such clash of clans and facebook does works, and applications such Uber and Netflix doesnt either. This issue happens in an kit kat emulator. Jelly Bean and ICS looks fine.
Here's what logcat says:
01-07 16:31:04.204 2979-2979/com.psafe.powerpro I/MultiDex﹕ VM with version 1.6.0 does not have multidex support
01-07 16:31:04.204 2979-2979/com.psafe.powerpro I/MultiDex﹕ install
01-07 16:31:04.212 2979-2979/com.psafe.powerpro I/MultiDex﹕ MultiDexExtractor.load(/data/app/com.psafe.powerpro-1.apk, false)
01-07 16:31:04.212 2979-2979/com.psafe.powerpro I/MultiDex﹕ loading existing secondary dex files
01-07 16:31:04.212 2979-2979/com.psafe.powerpro I/MultiDex﹕ load found 0 secondary dex files
01-07 16:31:04.212 2979-2979/com.psafe.powerpro I/MultiDex﹕ install done
01-07 16:31:04.232 2979-2979/com.psafe.powerpro I/dalvikvm﹕ Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method gQ.a
01-07 16:31:04.232 2979-2979/com.psafe.powerpro W/dalvikvm﹕ VFY: unable to resolve virtual method 6352: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
01-07 16:31:04.232 2979-2979/com.psafe.powerpro D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000e
01-07 16:31:04.256 2979-2995/com.psafe.powerpro I/GMPM﹕ App measurement is starting up
01-07 16:31:04.264 2979-2979/com.psafe.powerpro D/dalvikvm﹕ GC_FOR_ALLOC freed 354K, 14% free 3003K/3464K, paused 4ms, total 5ms
01-07 16:31:04.264 2979-2995/com.psafe.powerpro E/GMPM﹕ getGoogleAppId failed with status: 10
01-07 16:31:04.268 2979-2995/com.psafe.powerpro E/GMPM﹕ Uploading is not possible. App measurement disabled
01-07 16:31:04.280 2979-2979/com.psafe.powerpro D/dalvikvm﹕ Trying to load lib /data/data/com.psafe.powerpro/files/libmobilesafe360-jni-2.7.so 0xa50565b0
01-07 16:31:04.308 2979-2979/com.psafe.powerpro A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x000000b4 (code=1), thread 2979 (.psafe.powerpro)
Any toughts about it?

Apache Cordova Facebook Plugin (latest version/current master) crashes my android app while initializing

I've created the sample app given in the latest version (current master) of Apache Cordova Facebook Plugin several times:
https://github.com/phonegap/phonegap-facebook-plugin
Currently, I'm working on Android only.
The first time I created this sample app (about two weeks ago) everything worked fine. I successfully logged in with my facebook account, posted a status to my wall and logged out (all the other actions worked fine as well).
But since than I've created this sample app several more times (in the exact same way), and it has never worked again (the last time I tried was today). In the new apps (with the very same code as the first app, which still works), I press "LOGIN WITH FACEBOOK", and my app crashes immediately. Sometimes the app doesn't crash immediately, and I can get the message "Argument 'session' cannot be null". Then I press "LOGIN WITH FACEBOOK" again, and the app crashes. Sometimes I can get this message several times before the app eventually crashes.
If I press "LOGOUT WITH FACEBOOK", I get the message: "No valid session found, must call init and login before logout".
I also don't think that the problem is that I have a wrong hash key or something like that, because I've been careful with the settings of the facebook app every time.
I also believe that I've installed the plugin correctly each time, because I've always done it the same way I did it the first time, which worked fine.
So how is it that in my latest attempts the session variable is NULL??
Why did it work only in the first time??
I'm very frustrated..
Edit:
Here is the relevant segment of the LogCat log:
D/ConnectPlugin( 7064): login FB
W/dalvikvm( 7064): VFY: unable to resolve static field 2130 (com_facebook_internet_permission_error_title) in Lcom/facebook/android/R$string;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0010
I/dalvikvm( 7064): DexOpt: unable to optimize static field ref 0x0851 at 0x18 in Lcom/facebook/AuthorizationClient;.checkInternetPermission
W/dalvikvm( 7064): VFY: unable to resolve static field 2120 (com_facebook_login_activity_layout) in Lcom/facebook/android/R$layout;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0003
W/dalvikvm( 7064): VFY: unable to resolve static field 2103 (com_facebook_login_activity_progress_bar) in Lcom/facebook/android/R$id;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0008
I/ActivityManager( 2112): START {intent.toShortString} from pid 7064
I/power ( 2112): *** acquire_dvfs_lock : lockType : 1 freq : 1000000
D/PowerManagerService( 2112): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1000000 uid : 1000 pid : 2112 tag : ActivityManager
W/ActivityManager( 2112): mDVFSLock.acquire()
D/dalvikvm( 7064): GC_CONCURRENT freed 455K, 6% free 12931K/13639K, paused 4ms+5ms
W/PluginManager( 7064): THREAD WARNING: exec() call to FacebookConnectPlugin.login blocked the main thread for 207ms. Plugin should use CordovaInterface.getThreadPool().
D/CordovaActivity( 7064): Paused the application!
D/CordovaWebView( 7064): Handle the pause
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
D/webkit ( 7064): Firewall not null
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
I/ClipboardServiceEx( 2112): mCBPickerDialog enter case. MSG_DISMISS_DIALOG
D/webkit ( 7064): euler: isUrlBlocked = false
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
D/ActivityManager( 2112): Trying to launch applicationName
D/KeyguardViewMediator( 2112): setHidden false
I/ClipboardServiceEx( 2112): mCBPickerDialog enter case. MSG_DISMISS_DIALOG
D/AndroidRuntime( 7064): Shutting down VM
W/dalvikvm( 7064): threadid=1: thread exiting with uncaught exception (group=0x40c6c1f8)
E/AndroidRuntime( 7064): FATAL EXCEPTION: main
E/AndroidRuntime( 7064): java.lang.NoClassDefFoundError: com.facebook.android.R$layout
E/AndroidRuntime( 7064): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
E/AndroidRuntime( 7064): at android.app.Activity.performCreate(Activity.java:4562)
E/AndroidRuntime( 7064): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
E/AndroidRuntime( 7064): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
E/AndroidRuntime( 7064): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
E/AndroidRuntime( 7064): at android.app.ActivityThread.access$600(ActivityThread.java:128)
E/AndroidRuntime( 7064): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
E/AndroidRuntime( 7064): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7064): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 7064): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/AndroidRuntime( 7064): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7064): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 7064): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
E/AndroidRuntime( 7064): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
E/AndroidRuntime( 7064): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 2112): Force finishing activity com.yomama.test/com.facebook.LoginActivity
W/ActivityManager( 2112): Force finishing activity com.yomama.test/.Test
Another strange thing that happened to me yesterday was that I recompiled and re-installed (on my phone) the first working app, and suddenly it didn't work either (I got the same message after pressing "LOGIN WITH FACEBOOK", and then the app crashed). Then I recompiled and re-installed the app again, and it was working fine again. Weird.
Try the following steps (from this GitHub issue; had worked for me):
+### Android Setup without Eclipse (just CLI)
+Follow the steps above:
cordova create myApp
cd myApp/
cordova platform add android
cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication"
// add FacebookLib
echo "android.library.reference.2=com.phonegap.plugins.facebookconnect/FacebookLib" >> platforms/android/project.properties
cp platforms/android/local.properties platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
android update project -p platforms/android/
cd platforms/android/
ant clean
cd com.phonegap.plugins.facebookconnect/FacebookLib
ant clean
open -e AndroidManifest.xml
// change your minSdkVersion and your targetSdkVersion to your environment settings.
ant release
cd ../../../..
cordova build android
With this steps you can add the Plugin without using Eclipse

WebDav library Sardine on Android with httpclientandroidlib

Referencing to this thread Using webdav on Android
It is possible to use the Sardine lib ( http://code.google.com/p/sardine/) in combination with the httpclientandroidlib ( http://code.google.com/p/httpclientandroidlib/).
But I keep getting a java.lang.VerifyError Exception.
I tried to reference the Sardine lib as a jar file and as Eclipse-project but its always the same.
If i read the Messages from dalvikVM, before the exeption is thrown, there are problems with javax.xml.bind.JAXBContext.newInstance(). But i cant add the JAXB library or source to to the project because I get several Dx Errors:
[2011-10-28 16:48:40 - FireTablet] Dx 1 error; aborting
[2011-10-28 16:48:40 - FireTablet] Conversion to Dalvik format failed with error 1
[2011-10-28 16:49:00 - FireTablet] Dx
trouble processing "javax/xml/bind/PrintConversionEvent.class":
So this cant be the solution. Does anyone know how to run the sardine library on android?
I am very grateful for help!
Exceptions:
10-28 16:21:33.602: I/Process(22992): Sending signal. PID: 22992 SIG: 9
10-28 16:30:59.005: I/dalvikvm(23056): Could not find method javax.xml.bind.JAXBContext.newInstance, referenced from method com.googlecode.sardine.util.SardineUtil.<clinit>
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to resolve static method 20578: Ljavax/xml/bind/JAXBContext;.newInstance ([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
10-28 16:30:59.005: D/dalvikvm(23056): VFY: replacing opcode 0x71 at 0x000a
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to resolve exception class 2678 (Ljavax/xml/bind/JAXBException;)
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to find exception handler at addr 0x50
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejected Lcom/googlecode/sardine/util/SardineUtil;.<clinit> ()V
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejecting opcode 0x0d at 0x0050
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejected Lcom/googlecode/sardine/util/SardineUtil;.<clinit> ()V
10-28 16:30:59.005: W/dalvikvm(23056): Verifier rejected class Lcom/googlecode/sardine/util/SardineUtil;
10-28 16:30:59.005: D/AndroidRuntime(23056): Shutting down VM
10-28 16:30:59.005: W/dalvikvm(23056): threadid=1: thread exiting with uncaught exception (group=0x40015578)
10-28 16:30:59.009: E/AndroidRuntime(23056): FATAL EXCEPTION: main
10-28 16:30:59.009: E/AndroidRuntime(23056): java.lang.VerifyError: com.googlecode.sardine.util.SardineUtil
10-28 16:30:59.009: E/AndroidRuntime(23056): at com.googlecode.sardine.impl.SardineImpl.list(SardineImpl.java:339)
10-28 16:30:59.009: E/AndroidRuntime(23056): at hsr.ifs.firetablet.network.WebDavConnector.getFacilityNames(WebDavConnector.java:36)
I use Android API-Level 10 & Java 1.6.
Not sure what's going on, but did you try https://github.com/yeonsh/Sardine-Android ?
I also had the same issue and modified the Sardine project to use SimpleXml instead of JAXB. Here is my version of the library: https://github.com/thegrizzlylabs/sardine-android

Android limitation

I have one application in android when i run that application it shows that exception
09-13 16:38:25.049: WARN/dalvikvm(269): VFY: arbitrarily rejecting large method (regs=132 count=21332)
09-13 16:38:25.049: WARN/dalvikvm(269): VFY: rejected Lcom/ExtraCharge/Calc;.onClick (Landroid/view/View;)V
09-13 16:38:25.059: WARN/dalvikvm(269): Verifier rejected class Lcom/ExtraCharge/Calc;
09-13 16:38:25.059: WARN/dalvikvm(269): Class init failed in newInstance call (Lcom/ExtraCharge/Calc;)
09-13 16:38:34.883: WARN/ActivityManager(64): Launch timeout has expired, giving up wake lock!
09-13 16:38:34.999: WARN/ActivityManager(64): Activity idle timeout for HistoryRecord{43f8da58 com.ExtraCharge/.Calc}
Do you have any solution for that problem?
This may be of use:
http://www.mail-archive.com/android-developers#googlegroups.com/msg86311.html

Categories

Resources