Getting java.lang.VerifyError after upgrading to Android Studio 2.0 - android

I upgraded Android Studio to 2.0.
Then when I run & debug the app, it works fine until I click a button and call a function, and java.lang.VerifyError is thrown. This is what I get from logcat:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fronty.zt, PID: 18022
java.lang.VerifyError: com/fronty/zt/SilverCord$AjcClosure11
at com.fronty.zt.SilverCord.checkEmailExistence(SilverCord.java:407)
at com.fronty.zt.register.RegisterBasicActivity.onClick(RegisterBasicActivity.java:122)
at com.fronty.zt.register.RegisterBasicActivity$$ViewBinder$1.doClick(RegisterBasicActivity$$ViewBinder.java:26)
at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
This is checkEmailExistence():
#DebugLog
public void checkEmailExistence(StringPacket pack, final Response.Listener<ResponseBase> listener, Response.ErrorListener errorListener)
{
request("checkEmailExistence", ResponseBase.class, listener, errorListener, "/api/v0/check_email_existence", pack);
}
But when I set a breakpoint and follow, it actually goes deeper before it throws. checkEmailExistence() calls request() and the exception is thrown at the first line inside request()
if ( doLog )
Log.i( T, function );
I tried deleting build dir, rebuild, clean.. & etc with no effect.
However, changing gradle version fixes the problem:
classpath 'com.android.tools.build:gradle:2.0.0'
to
classpath 'com.android.tools.build:gradle:1.5.0'
But this will disable Instant Run, so I would like to stick to 2.0.0. Does anyone know the cause or how to go about this?
Thanks!

I get the same error.I think it is hugo lead to the problem . Don't use #DebugLog,I run my app without the problem

Related

app crashes when it queries to hosted parse server

I'm trying to migrate app to hosted parse server.App start but when it tries to query to hosted parse server it gets crashed.I had the issue with dependencies in the past now i fixed it.
If i use the parse service the app works fine.
Parse.enableLocalDatastore(this);
// Parse.initialize(this, "<key>", "<key>");
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("appid")
.clientKey("<key>")
.server("http://192.168.1.177:1337/parse/") // '/' important after 'parse'
.build());
Dependencies:
dependencies {
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
}
Error:
04-03 12:44:28.409 2911-2911/com.app.nameapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.app.nameapp, PID: 2911
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3823)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View$1.onClick(View.java:3818)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
Caused by: java.lang.IllegalStateException: Method requires Local Datastore. Please refer to `Parse#enableLocalDatastore(Context)`.
at com.parse.ParseQuery.throwIfLDSEnabled(ParseQuery.java:292)
at com.parse.ParseQuery.throwIfLDSDisabled(ParseQuery.java:286)
at com.parse.ParseQuery.access$200(ParseQuery.java:90) 
Could not able to post entire error message as it was very long. I think there is something wrong with parse local data store. As far as i know when pointing my app to hosted parse server i just need to add those few lines(appid,clientkey,server address). Is there any more changes needed in the app?  
  
try the following:
Parse.initialize(new Parse.Configuration.Builder(this) .applicationId("yourappid") .clientKey("yourclientkey") .server("serverurl") .enableLocalDataStore() .build() );
It seems like you are trying to initialize Parse from an onClickListener, therefore the object this you are passing to Parse is the wrong one.
if you refer to this from on OnClickListener you get a reference to the interface even though it's an inline declaration in the activity.
you need to manually point to the correct Context and use it.
try changing your code to look like this:
Parse.enableLocalDatastore(MyActivity.this);
// Parse.initialize(this, "<key>", "<key>");
Parse.initialize(new Parse.Configuration.Builder(MyActivity.this)
.applicationId("appid")
.clientKey("<key>")
.server("http://192.168.X.XXX:1337/parse/") // '/' important after 'parse'
.build());

Unmarshalling unknown type code 6881391 at offset 4752 After Upgrading to Support Libraries 23.2.0

My app has been working well at Support Libraries 23.1.1. However, after upgrading to Support Libraries 23.2.0, it starts to crash. The crash happens when I navigate from an activity back to the main activity (for example, I open the about activity from main activity's actionbar menu, then press back button to go back to main activity, then it crashes).
The crash log is here:
FATAL EXCEPTION: main Process: com.myapp.blah.blah, PID: 22124
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.myapp.blah.blah/com.myapp.blah.blah.ui.MainActivity}:
java.lang.RuntimeException: Parcel android.os.Parcel#41d10870:
Unmarshalling unknown type code 6881391 at offset 4752 at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2429)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$800(ActivityThread.java:166) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:136) at
android.app.ActivityThread.main(ActivityThread.java:5584) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:515) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at
dalvik.system.NativeStart.main(Native Method) Caused by:
java.lang.RuntimeException: Parcel android.os.Parcel#41d10870:
Unmarshalling unknown type code 6881391 at offset 4752 at
android.os.Parcel.readValue(Parcel.java:2087) at
android.os.Parcel.readArrayMapInternal(Parcel.java:2321) at
android.os.Bundle.unparcel(Bundle.java:249) at
android.os.Bundle.getSparseParcelableArray(Bundle.java:1273) at
com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1884)
at android.app.Activity.onRestoreInstanceState(Activity.java:989) at
android.app.Activity.performRestoreInstanceState(Activity.java:961) at
android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1145)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2407)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)?
at android.app.ActivityThread.access$800(ActivityThread.java:166)? at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)?
at android.os.Handler.dispatchMessage(Handler.java:102)? at
android.os.Looper.loop(Looper.java:136)? at
android.app.ActivityThread.main(ActivityThread.java:5584)? at
java.lang.reflect.Method.invokeNative(Native Method)? at
java.lang.reflect.Method.invoke(Method.java:515)? at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)?
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)? at
dalvik.system.NativeStart.main(Native Method)?
The crash only happens if I set the developer debug option "do not keep activities" on. The crash does not happen if this option is off.
The crashes happens in debug mode where no Proguard is used.
I do not pass any parcels/bundles between the activities, and do not use startActivityForResult().
Crash happens on both pre and post Lollipop devices.
I found two similar posts here and here which might (or might not) be related.
Unmarshalling exception when using SearchView with an id resource in
appcompat 23.2
Hi, it can fix by implement onSavedInstance and onRestore but don't use super. This strange behavior
#Override
protected void onSaveInstanceState(Bundle outState) {
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
}

com.facebook.FacebookGraphObjectException: Factory can't proxy method: public abstract void com.facebook.model.GraphUser.setBirthday()

I have been editing the FriendPikcerSample provided by Facebook SDK for Android (latest version).
A couple of hours ago I successfully inserted a listview instead of a textview, so that when I select a name in the ListView, I can fetch more details of the user in the further activity
But Now, after restarting my PC, the app is behaving weird. When I launch it and click on "Pick Friends", it should be showing the list of friends who are using the app. Instead, now the app crashes and logcat shows this error.
12-30 07:35:15.820 2238-2238/com.facebook.samples.friendpicker E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.facebook.samples.friendpicker, PID: 2238
com.facebook.FacebookGraphObjectException: Factory can't proxy method: public abstract void com.facebook.model.GraphUser.setBirthday()
at com.facebook.model.GraphObject$Factory.verifyCanProxyClass(GraphObject.java:290)
at com.facebook.model.GraphObject$Factory.createGraphObjectProxy(GraphObject.java:216)
at com.facebook.model.GraphObject$Factory.coerceValueToExpectedType(GraphObject.java:340)
at com.facebook.model.GraphObject$Factory$GraphObjectListImpl.get(GraphObject.java:772)
at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:55)
at java.util.AbstractCollection.toArrayList(AbstractCollection.java:349)
at java.util.AbstractCollection.toArray(AbstractCollection.java:339)
at java.util.ArrayList.addAll(ArrayList.java:188)
at com.facebook.widget.SimpleGraphObjectCursor.addGraphObjects(SimpleGraphObjectCursor.java:46)
at com.facebook.widget.GraphObjectPagingLoader.addResults(GraphObjectPagingLoader.java:203)
at com.facebook.widget.GraphObjectPagingLoader.requestCompleted(GraphObjectPagingLoader.java:186)
at com.facebook.widget.GraphObjectPagingLoader.access$000(GraphObjectPagingLoader.java:27)
at com.facebook.widget.GraphObjectPagingLoader$2.onCompleted(GraphObjectPagingLoader.java:134)
at com.facebook.Request$4.run(Request.java:1666)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Can anyone help me understand what's gone wrong?

Clockwork package installer stopped

Recently, I've been coding an APP which could work for an Android Device and an Android Wearable.
Today, I finished developments, and I've created a production APK following http://developer.android.com/training/wearables/apps/packaging.html tutorial.
However, when I install APK on a device, it works, but it doesn't get pushed to device.
Device crashes with message:
This is the stacktrace returned by Wearable:
08-04 21:53:47.957 914-914/com.google.android.clockwork.packageinstaller E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.android.clockwork.packageinstaller, PID: 914
java.lang.NullPointerException
at java.util.jar.Manifest.read(Manifest.java:187)
at java.util.jar.Manifest.<init>(Manifest.java:106)
at java.util.jar.StrictJarFile.<init>(StrictJarFile.java:65)
at android.content.pm.PackageParser.collectManifestDigest(PackageParser.java:594)
at com.google.android.clockwork.packageinstaller.PackageUtil.getPackageInfo(PackageUtil.java:76)
at com.google.android.clockwork.packageinstaller.PackageInstallerService.installPackage(PackageInstallerService.java:144)
at com.google.android.clockwork.packageinstaller.PackageInstallerService.access$000(PackageInstallerService.java:29)
at com.google.android.clockwork.packageinstaller.PackageInstallerService$1.handleMessage(PackageInstallerService.java:55)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5026)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
I don't really know how to debug this.
APP works perfectly when pushed via ADB.
Tell me if you do need any further info.
Thanks.
Well... Today it worked.
What did I do:
Clean
Removed old APK generated (.....\mobile\build\outputs\apk)
Compile via gradle via script "assembleRelease"
Now it works.

Sinch Android Messaging Tutorial App crashes upon login and client isn't started

The android tutorial app keeps crashing once a user has been logged in. Client also doesn't start.
Logcat Says
08-03 12:45:16.183 1322-1322/com.example.messagingtutorialskeleton W/linker﹕ libhoudini.so has
text relocations. This is wasting memory and is a security risk. Please fix.
08-03 12:45:16.655 1322-1322/com.example.messagingtutorialskeleton A/libc﹕ Fatal signal 11
(SIGSEGV) at 0x000000b4 (code=1), thread 1322 (utorialskeleton)
This occurs when using a Genymotion emulator.
When using the standard android virtual device, the logcat reads:
08-03 08:45:00.705 2406-2406/com.example.messagingtutorialskeleton E/AndroidRuntime﹕ FATAL
EXCEPTION: main
Process: com.example.messagingtutorialskeleton, PID: 2406
java.lang.UnsatisfiedLinkError: Couldn't load sinch-android-rtc from loader
dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/com.example.messagingtutorialskeleton-2.apk"],nativeLibraryDirectories=[/data/app-
lib/com.example.messagingtutorialskeleton-2, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.sinch.android.rtc.internal.natives.jni.UserAgentFactory.<clinit>
(UserAgentFactory.java:9)
at
com.sinch.android.rtc.internal.client.ServiceFactory.createUserAgent(ServiceFactory.java:43)
at com.sinch.android.rtc.internal.client.DefaultSinchClient.<init>
(DefaultSinchClient.java:144)
at
com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClie ntFactory.java:13)
at
com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
at
com.sinch.messagingtutorialskeleton.MessageService.startSinchClient(MessageService.java:58)
at
com.sinch.messagingtutorialskeleton.MessageService.onStartCommand(MessageService.java:42)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2702)
at android.app.ActivityThread.access$2100(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Whats the problem? Thanks.
Yup i got the fix!...you just need to store all your Sinch architecture files into jniLibs folder as indicated in the tutorial.
The folder hence will include three folders which come along with the SDK namely;
1. Armeabi
2 Armeabi-v7a
3. X86
The error that you're getting is due to the missing x86 folder. Hence Do the needful and if you get stuck then please ask! 😊
The Sinch SDK isn't tested on the Genymotion emulator because it doesn't yet support x86. Here is a full explanation: https://github.com/sinch/android-messaging-tutorial/issues/1#issuecomment-50063315
Have you tried testing the app on a physical device?

Categories

Resources