canelmas / let

Annotation based simple API flavored with AOP to handle new Android runtime permission model
Apache License 2.0
530 stars 40 forks source link

java.lang.VerifyError: ActivityWelcome$AjcClosure1 #3

Closed jachenry closed 7 years ago

jachenry commented 8 years ago

Ever since adding the AskPermissions annotations I've been getting the VerifyError below:

java.lang.VerifyError: ActivityWelcome$AjcClosure1

This is honestly my first time seeing an error of this sort so I'll keep digging to see if there's a way to resolve on my own. Posting here just incase others experience a similar issue or have suggestions for resolving.

  @AskPermission(Manifest.permission.ACCESS_FINE_LOCATION)
  private void startTrackingLocation() {
    mTracker = LocationTracker.getInstance(this);
    mTracker.startTracking();
  }

EDIT

Forgot to mention this is happening on android 4.4.1 and 4.4.2 from what I can tell so far.

canelmas commented 8 years ago

Thanks @jachenry .

Strange. It seems like a compile time thing. What is the java version you're targeting ? 1.6, 1.7 ?

I'll try to dig into this issue as soon as I can. In the meantime I'll be happy to hear about your progress.

jachenry commented 8 years ago

@canelmas I'm targeting 1.8 in order to use retrolambda plugin. It may only be an issue on emulators. I'll keep you posted on any updates.

2hamed commented 8 years ago

I'm having the same problem with APIs prior to 21. Strangely I too am doing some location related stuff after getting the permission.

embydextrous-zz commented 8 years ago

I think this issue happens on multidex build where let code is in secondary .dex file.

2hamed commented 8 years ago

@embydextrous My build was not multidex.

embydextrous-zz commented 8 years ago

I am getting this error in debug build where let code is in classes2.dex while in release build there is only one dex file so not getting this error.

okram2000 commented 8 years ago

Hi guys, I could circumvent this problem building as release too. I have java 1.7 as target and the problems exists with Android 4.4 and 4.3 installations over here. Regards -Marko

bugraoral commented 8 years ago

This seems to be because of code swapping added with android gradle plugin 2+. It works fine when building using command line or instant run turned off. Possibly related to https://code.google.com/p/android/issues/detail?id=204360

canelmas commented 8 years ago

Can you guys please confirm if this is the case as well for you?

@okram2000 @embydextrous @2hamed @jachenry

embydextrous-zz commented 8 years ago

@bugraoral

If this is the issue with code swapping. It should not have been observed in release builds. Code swapping does not work for release builds.

2hamed commented 8 years ago

I had the issue with a release build as well. Will test more though.

UPDATE: Tested again with Instant Run disabled and it worked!

okram2000 commented 8 years ago

Hey guys, I cannot reproduce this error with release builds. Only with debug builds! Furthermore: Disabling instant run also fixes this error for me! Greetings -Marko

embydextrous-zz commented 8 years ago

I have also not observed this error in release builds. I think instant run is the culprit. But I guess when I got this error first time I was using a lower version of android studio and instant run was not present. Instant run is nightmare a lot of times. Sometimes it swaps my icons and do stupid stuff. I think this is not a library bug.