Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError sometimes. #37

Closed
pepyakin opened this issue Nov 5, 2014 · 57 comments
Closed

NoClassDefFoundError sometimes. #37

pepyakin opened this issue Nov 5, 2014 · 57 comments

Comments

@pepyakin
Copy link

pepyakin commented Nov 5, 2014

I have strange issue for a quite some time, sometimes when I build my app, following exception occur.

    java.lang.NoClassDefFoundError: com.wheely.app.utils.PhoneCodeUtils$$Lambda$1
            at com.wheely.app.utils.PhoneCodeUtils.preloadPhoneNumberUtil(PhoneCodeUtils.java:133)
            at com.wheely.app.WheelyApplication.onCreate(WheelyApplication.java:92)
            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4328)
            at android.app.ActivityThread.access$1500(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            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 first occurrence of lambda on code path, so I think that either retrolambda didn't run or it's result classes not included in final dex. Cleaning the project usually makes the deal.
But it seems this happens more frequently eventually.
I tend to think it is somehow related to incremental building, but not sure.

@luontola
Copy link
Owner

luontola commented Nov 5, 2014

Which versions of the Gradle plugin and Retrolambda are you using?

Based on the error message, the containing class was processed with Retrolambda and it should have written the Lambda$1 class, but for some reason the Lambda$1 class was removed after that. Sounds like something related to incremental compilation. @evant can you have a look at this?

@pepyakin
Copy link
Author

pepyakin commented Nov 5, 2014

I'm using gradle-retrolambda of 2.4.0 with gradle plugin 0.13.3.
Build tools version 21.

@evant
Copy link
Contributor

evant commented Nov 5, 2014

This very well may be an issue with incremental building in the gradle plugin. Try seeing if you can consistently reproduce it by changes some file(s). Then run gradle assembleDebug --info and report the retrolambda output which should include exactly which files it changed/updated.

@dbachelder
Copy link

I can confirm this issue. It always showed up in the same spot using a lambda as a comparator with Collections.sort . a clean would always take care of it. I saw this on 1.x and still see it on 2.x of the gradle plugin. Eventually I removed that one lambda and I haven't seen the problem since

@evant
Copy link
Contributor

evant commented Nov 5, 2014

@dbachelder You said you saw it on 1.x? That's strange, because incremental builds wasn't added until 2.0.0

@pepyakin
Copy link
Author

pepyakin commented Nov 5, 2014

It is repeatedly reproduces when I checkout some other branch, such is 2-3 commits ahead/behind, so very few files are changed. So here is my retrolambda output.

:app:compileRetrolambdaDevDebug
Executing task ':app:compileRetrolambdaDevDebug' (up-to-date check took 0.082 secs) due to:
  Input file /Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$string.class has changed.
  Input file /Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/RatingActivity$1.class has changed.
  Input file /Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/RefineRequestHandler.class has changed.
Starting process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java''. Working directory: /Users/pepyakin/dev/wheely/wheely_android/app Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Dretrolambda.bytecodeVersion=51 -Dretrolambda.classpath=/Users/pepyakin/dev/wheely/wheely_android/app/libs/droidinspectorserver.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.makeramen/roundedimageview/1.3.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/uk.co.chrisjenx/calligraphy/1.1.0/1069a9bca1cb0162881179a799d273d45e9aee14/calligraphy-1.1.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.netflix.rxjava/rxjava-core/0.19.6/b18f01b635f39f0a6af7ae792f07cb003a51e6a2/rxjava-core-0.19.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/wheely_android.libs/payment-kit/unspecified/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.github.castorflex.smoothprogressbar/library/1.0.1-SNAPSHOT/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.adjust.sdk/adjust-android/3.0.0/c13569cc86713d0c588e0255d68079f64122ffc9/adjust-android-3.0.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/libs/internal_impl-21.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.3/56498efd17752898cfcc3868c1b6211a07b12b8f/joda-time-2.3.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/6.1.11/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.netflix.rxjava/rxjava-android/0.19.6/c4a0635d906397bbe144896fa6f6867668cabb40/rxjava-android-0.19.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/classes.jar:/Users/pepyakin/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.0/support-annotations-21.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.0.0/2534c458682c73f5b9871131ab3098d3f987ca3/okio-1.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3/5fc52c41ef0239d1093a1eb7c3697036183677ce/gson-2.3.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/org.joda/joda-convert/1.6/bdb5cdf9d85c2aae59a0d914845f3304d346a886/joda-convert-1.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.helpshift/android-aar/3.5.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/org.lucasr.dspec/dspec/0.1.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp/okhttp/2.0.0/4c8d1536dba3812cc1592090dc20c47a4ed3c35e/okhttp-2.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup/otto/1.3.5/7941cd2c2c8ec006800d75c35f8a9dacf892ab93/otto-1.3.5.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.google.android/multidex/0.1/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.0/libs/internal_impl-21.0.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.googlecode.libphonenumber/libphonenumber/6.2/3ddc8255a39cc0505a6a34c56c9ec256833d2239/libphonenumber-6.2.jar:/Users/pepyakin/dev/wheely/wheely_android/app/libs/yozio-android-sdk.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.picasso/picasso/2.2.0/74137f8d9aac26dd9463efe32271f2be8d41cda9/picasso-2.2.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug:/Users/pepyakin/android-sdk/platforms/android-21/android.jar -Dretrolambda.includedFiles=/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$string.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/RatingActivity$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/RefineRequestHandler.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/offer/HelpActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/WheelyApplication$2.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$integer.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/PinVerifyFragment$3.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/HomeActivity$4.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/ChangeOrderPaymentActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/RatingActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/CardListAdapter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/offer/OffersActivity$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/HomeActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/drawer/widget/TwoLineDrawerItemView.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/android/support/v7/appcompat/R$layout.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/RailFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListFragment$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/ProgressFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/WheelyApplication$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/HouseFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/ActiveOrdersService.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$id.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/offer/OffersActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$plurals.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListAdapter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderDetailsFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/offer/OffersAdapter$ViewHolder.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/OrderController$EraseFromDb.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/DefaultDialogListener.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/ReferralActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/offer/PaymentDialog.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/NearbyFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/ActiveOrdersService$NotificationData.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/DebtsFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$menu.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/ProfileEditActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/SelectCardActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/RatingFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/DigitsLine.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/ProfileFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/widget/LicensePlateView.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListAdapter$LoadMoreViewHolder.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SearchCatalogueAdapter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/PhoneEntryFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderDetailsFragment$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/RouteMapViewController.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/ServiceBaseActivity$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$layout.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/PasswordSignInFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/ServiceBaseActivity$RatePopoverReceiver.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/ServiceBaseActivity$MyLayoutInflater.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/PinKeyboard.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/drawer/widget/BadgeDrawerItemView.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/WheelyApplication$1$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/content/InviteImageGenerator.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/BaseHandler.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/RedeemCodeFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/FaqFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/PayWithFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/helpshift/R$id.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SearchCatalogueAdapter$StaticCatalogueItemViewHolder.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/WheelygramFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/utils/PriceUtils.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/AirportsFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderDetailsFragment$1$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/GMSAbsenseActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/RouteButtonsController.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/PinVerifyFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/RebookDialog.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/GeocodeRequestHandler.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/ScheduledOrdersService.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/paymentkit/R$id.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListFragment$2.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/ActiveOrdersService$2.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/ServiceBaseActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/OrderController.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/ProfileEditFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$raw.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SearchFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/AutocompleteRequestHandler.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/ServiceBaseActivity$1$1.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListFragment$3.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/paymentkit/R$layout.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderViewFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/OrderListAdapter$OrderViewHolder.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderFormatter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/CountrySelectionFragment$CountryAdapter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SiteAdapter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$style.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/OrderController$PersistToDb.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/PinVerifyFragment$2.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/R$styleable.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/service/helpers/BaseHandler$HandlerContext.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SearchCatalogueFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/CountrySelectionFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/AbstractMapFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/HomeActivity$2.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/widget/OrderTaskBar.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/LocationPickerMapFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/HomeActivity$3.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/RedeemCodeFragment$3.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/drawer/widget/DrawerItemView.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/PayWithActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/BaseSearchFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/DistanceFormatter.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderViewActivity.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/common/LocationPickerController.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/order/OrderDetailsController.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/location/SiteAdapterHelper$SiteViewHolder.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/CardFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/InviteFriendFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/ui/home/profile/login/UserInfoFragment.class:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug/com/wheely/app/WheelyApplication.class -Dretrolambda.inputDir=/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug -Dretrolambda.outputDir=/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/classes/dev/debug -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /Users/pepyakin/.gradle/caches/modules-2/files-2.1/net.orfjackal.retrolambda/retrolambda/1.6.0/1c4ea2ef7e2a5541b8f2e263dfe49f7895122af7/retrolambda-1.6.0.jar net.orfjackal.retrolambda.Main
Successfully started process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java''
Retrolambda 1.6.0
Bytecode version: 51 (Java 7)
Input directory:  /Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug
Output directory: /Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/classes/dev/debug
Classpath:        /Users/pepyakin/dev/wheely/wheely_android/app/libs/droidinspectorserver.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.makeramen/roundedimageview/1.3.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/uk.co.chrisjenx/calligraphy/1.1.0/1069a9bca1cb0162881179a799d273d45e9aee14/calligraphy-1.1.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.netflix.rxjava/rxjava-core/0.19.6/b18f01b635f39f0a6af7ae792f07cb003a51e6a2/rxjava-core-0.19.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/wheely_android.libs/payment-kit/unspecified/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.github.castorflex.smoothprogressbar/library/1.0.1-SNAPSHOT/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.adjust.sdk/adjust-android/3.0.0/c13569cc86713d0c588e0255d68079f64122ffc9/adjust-android-3.0.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/libs/internal_impl-21.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.3/56498efd17752898cfcc3868c1b6211a07b12b8f/joda-time-2.3.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/6.1.11/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.netflix.rxjava/rxjava-android/0.19.6/c4a0635d906397bbe144896fa6f6867668cabb40/rxjava-android-0.19.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/classes.jar:/Users/pepyakin/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.0/support-annotations-21.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.0.0/2534c458682c73f5b9871131ab3098d3f987ca3/okio-1.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3/5fc52c41ef0239d1093a1eb7c3697036183677ce/gson-2.3.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/org.joda/joda-convert/1.6/bdb5cdf9d85c2aae59a0d914845f3304d346a886/joda-convert-1.6.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.helpshift/android-aar/3.5.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/org.lucasr.dspec/dspec/0.1.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp/okhttp/2.0.0/4c8d1536dba3812cc1592090dc20c47a4ed3c35e/okhttp-2.0.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup/otto/1.3.5/7941cd2c2c8ec006800d75c35f8a9dacf892ab93/otto-1.3.5.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.google.android/multidex/0.1/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.0/libs/internal_impl-21.0.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0/classes.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.0/classes.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.googlecode.libphonenumber/libphonenumber/6.2/3ddc8255a39cc0505a6a34c56c9ec256833d2239/libphonenumber-6.2.jar:/Users/pepyakin/dev/wheely/wheely_android/app/libs/yozio-android-sdk.jar:/Users/pepyakin/.gradle/caches/modules-2/files-2.1/com.squareup.picasso/picasso/2.2.0/74137f8d9aac26dd9463efe32271f2be8d41cda9/picasso-2.2.0.jar:/Users/pepyakin/dev/wheely/wheely_android/app/build/retrolambda/devDebug:/Users/pepyakin/android-sdk/platforms/android-21/android.jar
Included files:   115
Saving lambda class: com/wheely/app/service/ActiveOrdersService$2$$Lambda$1
Saving lambda class: com/wheely/app/service/ActiveOrdersService$$Lambda$1
Saving lambda class: com/wheely/app/service/ActiveOrdersService$$Lambda$2
Saving lambda class: com/wheely/app/service/ActiveOrdersService$$Lambda$3
Saving lambda class: com/wheely/app/ui/common/LocationPickerMapFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/common/LocationPickerMapFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/common/LocationPickerMapFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/common/LocationPickerMapFragment$$Lambda$4
Saving lambda class: com/wheely/app/ui/common/RouteButtonsController$$Lambda$1
Saving lambda class: com/wheely/app/ui/common/RouteButtonsController$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/FaqFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$4
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$5
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$6
Saving lambda class: com/wheely/app/ui/home/HomeActivity$$Lambda$7
Saving lambda class: com/wheely/app/ui/home/OrderListAdapter$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/OrderListFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/OrderListFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/CardFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/CardListAdapter$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/DebtsFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/login/CountrySelectionFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/login/PhoneEntryFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/login/PhoneEntryFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/login/PhoneEntryFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/login/PinVerifyFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/login/PinVerifyFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/login/PinVerifyFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/login/UserInfoFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/login/UserInfoFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/login/UserInfoFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/login/UserInfoFragment$$Lambda$4
Saving lambda class: com/wheely/app/ui/home/profile/PasswordSignInFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/PayWithActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/PayWithActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/PayWithFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/PayWithFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditActivity$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditActivity$$Lambda$4
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/ProfileEditFragment$$Lambda$4
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$4
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$5
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$6
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$7
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$8
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$9
Saving lambda class: com/wheely/app/ui/home/profile/ProfileFragment$$Lambda$10
Saving lambda class: com/wheely/app/ui/home/profile/RedeemCodeFragment$3$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/RedeemCodeFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/profile/SelectCardActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/ReferralActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/home/ReferralActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/location/HouseFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/location/SearchCatalogueAdapter$$Lambda$1
Saving lambda class: com/wheely/app/ui/location/SearchCatalogueAdapter$$Lambda$2
Saving lambda class: com/wheely/app/ui/location/SearchCatalogueAdapter$$Lambda$3
Saving lambda class: com/wheely/app/ui/location/SearchFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/location/SearchFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/location/SiteAdapter$$Lambda$1
Saving lambda class: com/wheely/app/ui/offer/OffersActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/offer/OffersActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/offer/OffersActivity$$Lambda$3
Saving lambda class: com/wheely/app/ui/offer/OffersActivity$$Lambda$4
Saving lambda class: com/wheely/app/ui/offer/OffersActivity$$Lambda$5
Saving lambda class: com/wheely/app/ui/offer/PaymentDialog$$Lambda$1
Saving lambda class: com/wheely/app/ui/offer/PaymentDialog$$Lambda$2
Saving lambda class: com/wheely/app/ui/offer/PaymentDialog$$Lambda$3
Saving lambda class: com/wheely/app/ui/order/ChangeOrderPaymentActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/ChangeOrderPaymentActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/order/OrderDetailsController$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$4
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$5
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$6
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$7
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$8
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$9
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$10
Saving lambda class: com/wheely/app/ui/order/OrderDetailsFragment$$Lambda$11
Saving lambda class: com/wheely/app/ui/order/OrderViewActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/OrderViewActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/order/OrderViewFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/OrderViewFragment$$Lambda$2
Saving lambda class: com/wheely/app/ui/order/OrderViewFragment$$Lambda$3
Saving lambda class: com/wheely/app/ui/order/RatingActivity$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/RatingActivity$$Lambda$2
Saving lambda class: com/wheely/app/ui/order/RatingActivity$$Lambda$3
Saving lambda class: com/wheely/app/ui/order/RatingActivity$$Lambda$4
Saving lambda class: com/wheely/app/ui/order/RatingActivity$$Lambda$5
Saving lambda class: com/wheely/app/ui/order/RatingFragment$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/RebookDialog$$Lambda$1
Saving lambda class: com/wheely/app/ui/order/RebookDialog$$Lambda$2
:app:compileRetrolambdaDevDebug (Thread[main,5,main]) completed. Took 0.888 secs.

@luontola
Copy link
Owner

It occurred to me to think about that what kind of a mechanism Gradle or Javac might be using for detecting that which files have changed. Reading the source would be best to find out the answer, but one possibility is that it looks at the SourceFile entries in the bytecode, which the lambda classes are missing.

@pepyakin Can you try reproducing this issue with a modified version of Retrolambda? First find out steps that reproduces it reliably for PhoneCodeUtils$$Lambda$1. Then do the following change to Retrolambda, mvn clean install it (see BUILDING for env setup), switch to using it in Gradle, and retry the steps.

--- a/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/BackportLambdaClass.java
+++ b/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/BackportLambdaClass.java
@@ -53,6 +53,7 @@ public class BackportLambdaClass extends ClassVisitor {

     @Override
     public void visitEnd() {
+        super.visitSource("PhoneCodeUtils.java", null);
         if (isStateless()) {
             makeSingleton();
         }

If that fixes it or if the error message changes to complain about some other files, then maybe we're onto something.

@pepyakin
Copy link
Author

I can't reproduce issue anymore. I tried several options like changing different source and resources, checkout "distant" commits and so on, but bad luck.
I'll write back if encounter issue once again and will try with modified version of Retrolambda.

@wkarl
Copy link

wkarl commented Nov 24, 2014

I can confirm this issue, it only occurs here (using RxJava):
observable.observeOn(AndroidSchedulers.mainThread())
.subscribe(photos -> onNext(photos), error -> onError(error))

@luontola
Copy link
Owner

@wkarl Good. Can you try if using a modified version of Retrolambda fixes it, as I explained earlier? (Of course change the source file name to match your file.) Or can you create a SSCCE?

@wkarl
Copy link

wkarl commented Nov 26, 2014

Sorry for the late reply. After a clean it worked again and I wasn't able to reproduce the issue ever since... if it resurfaces I will try the modified version!

@pepyakin
Copy link
Author

pepyakin commented Dec 2, 2014

@orfjackal So I've reproduced this issue with modified version and it makes no difference.

@luontola
Copy link
Owner

luontola commented Dec 2, 2014

OK, so at least that fix won't work. More debugging is needed, maybe even digging into the code of Gradle's incremental compiler.

If you manage to determine steps for reproducing this issue reliably, please post it here.

@pepyakin
Copy link
Author

pepyakin commented Dec 2, 2014

I just found two commits such when I switch back and forth between them I'm expierence this issue, so I can't call it "reliable".
I will try to examine what files are changing and hope that will help.

@Diolor
Copy link

Diolor commented Jan 8, 2015

Any news on that topic? e.g. solved with a newer version of e.g gradle?

@dlew
Copy link

dlew commented Jan 15, 2015

I've seen this issue repeatedly as well. What's interesting is that it only seems to affect certain classes; put a lambda anywhere in one, and it will eventually run into this issue, repeatedly, through multiple cleans. But most classes don't run into it.

I'll try running some debugging on it next time I run into this, to figure out what is different about these classes in particular.

@erickok
Copy link

erickok commented Jan 23, 2015

I am experiencing this as well and can confirm that it is resolved when I perform a 'gradle clean' and rebuild. I will try to isolate a minimal reproducible example.

@evoxmusic
Copy link

Hi all,

I still get this error as well, by performing "gradle clean" and rebuild it seems to clear the problem but is there any fix coming ?

Thanks

@alwaysthecritic
Copy link

I'm seeing this as well - exactly as described by others. Usually crops up in the same place in the same class. Anecdotally, I also have been noticing that sometimes the app doesn't reflect my code changes, which drives me crazy figuring out why things weren't working for a while, but then it magically starts working as it (presumably) finally picks up my new code. This has only happened in recent weeks and is the first time my dev experience has been anything other than rock solid.

@IlyaEremin
Copy link

I'm also face with the problem only on certain classes and I can't figure out on what depends this error. It appears random. I use RxJava and retrofit, but I think that most of retrolambda users use these libraries.

@teddis
Copy link

teddis commented Feb 17, 2015

I had this problem today as well and can confirm that rebuilding/cleaning fixed the problem. I'm using AndroidStudio 1.1 Beta 4 with Gradle 1.0.0, RxJava using gradle dependencies compile 'io.reactivex:rxandroid:0.23.0' and classpath 'me.tatarka:gradle-retrolambda:2.5.0'. I got the following exception when trying to open a new activity:

02-17 15:54:52.160 W/System.err(19910): java.lang.NoClassDefFoundError: com.gameontechnology.gameon.ui.activity.AcceptInviteActivity$$Lambda$1
02-17 15:54:52.160 W/System.err(19910):     at com.gameontechnology.gameon.ui.activity.AcceptInviteActivity.onCreate(AcceptInviteActivity.java:56)

which references the following code in my onCreate method:

        closeButton.setOnClickListener(v -> finish());

@rafaeltoledo
Copy link

Same problem here. Seems to be something related with Android Gradle plugin. I was using 1.1.0 and was facing the crash. After downgrading to 1.0.1, the crash went away. Maybe something new in the plugin is causing this?

I'm using the gradle plugin 2.5.0 with retrolambda 1.8.1

@osunnarvik
Copy link

Looks like I have a deterministic way of reproducing this issue, have been reproducing 10 times in a row now by the following scenario.

I have two classes (ClassA and ClassB). ClassB contains lambdas, and ClassA is the one that allocates ClassB.
If I make a change in ClassA without making a change in ClassB, I get this issue. Whenever I make a change in ClassB, the problem goes away.

So, it naturally enough does not rebuild ClassB when there are no changes in ClassB, but why does it remove the lambda-class of ClassB when the one that allocates ClassB is changed?

@Diolor
Copy link

Diolor commented Mar 19, 2015

@osunnarvik Your replication is correct. The conflict might be with Dex/pre-Dexing.

For the time: you can use proguard to catch that in the compilation and see if you need a clean build

@daveztong
Copy link

@osunnarvik You are right. I did reproduce this issue by following the scenario you described.

I'm facing the same problem as well. It only happens in one place. Clean and rebuild fix the problem. I'm also using RxJava and retrofit.

@evant
Copy link
Contributor

evant commented Apr 2, 2015

Anyone running into this issue, can you try updating to 3.0.0 and setting incremental to false? If that fixes it then it's definitely and issue in the gradle plugin.

@evant
Copy link
Contributor

evant commented Apr 3, 2015

Also, @osunnarvik or anyone else, mind posting a sample project that has the issue as you describe it? I tried to reproduce it with my own ClassA and ClassB myself, but couldn't. There might be something more subtle here that I'm missing.

@cre8ivejp
Copy link

I have the same problem here using the version 2.5.0
clean and build the project it seems to solve the problem.

@omjokine
Copy link

I had same problem as @osayilgan: works in local machine but fails in Travis. Problem was
java.lang.NoClassDefFoundError: android/support/v4/view/LayoutInflaterFactory
(I have class that extends android.support.v4.app.Fragment and it's using lambdas)
Managed to fix problem by downgrading support-v4 from 22.1.0 back to 22.0.0

So maybe there's some issue with support-v4:22.1.0

Also checked with 22.1.1 and problem still occurs.

@osayilgan
Copy link

@omjokine I'm using support v4 22.0.0 and I still have the same issue. CI fails but it's ok in my Local machine. I thought it might have something to do with @aar processing.

@shekibobo
Copy link

I am seeing this problem after upgrading the android support libs from 22.0 to 22.1.

It will compile fine if I run ./gradlew clean testDebug, but it will fail if I run the tests like our CI server: ./gradlew clean; ./gradlew assembleDebug; ./gradlew testDebug;. It seems running clean as a separate task is a little more thorough in deleting all build artifacts.

I'm running gradle-retrolambda:3.0.1. It still fails if I set incremental false.

/cc @evant

It looks like retrolambda is able to build a few files until it reaches the first one that subclasses a support.v4.Fragment:

latforms/android-22/android.jar
Saving lambda class: com/myproject/android/controller/supplies/SuppliesFragment$SuppliesListAdapter$$Lambda$1
Saving lambda class: com/myproject/android/view/listitem/OrdinalStringSettingListItemView$$Lambda$1
Saving lambda class: com/myproject/android/view/listitem/OrdinalStringSettingListItemView$$Lambda$2
Saving lambda class: com/myproject/android/data/webservice/listener/GetDefaultLocationSuccessListener$$Lambda$1
Saving lambda class: com/myproject/android/data/webservice/listener/GetDefaultLocationSuccessListener$$Lambda$2
Error! Failed to transform some classes
java.lang.RuntimeException: java.lang.IllegalAccessException: no such method: com.myproject.android.controller.detail.status.StatusFragment.lambda$setupSupplyView$51(Supply,View)void/invokeSpecial
  at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:42)
  at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.backportLambda(BackportLambdaInvocations.java:105)
  at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.visitInvokeDynamicInsn(BackportLambdaInvocations.java:94)
  at net.orfjackal.retrolambda.asm.ClassReader.readCode(ClassReader.java:1439)
  at net.orfjackal.retrolambda.asm.ClassReader.readMethod(ClassReader.java:1017)
  at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:693)
  at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:506)
  at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:96)
  at net.orfjackal.retrolambda.Transformers.backportClass(Transformers.java:44)
  at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:73)
  at net.orfjackal.retrolambda.Main.main(Main.java:26)
Caused by: java.lang.IllegalAccessException: no such method: com.myproject.android.controller.detail.status.StatusFragment.lambda$setupSupplyView$51(Supply,View)void/invokeSpecial
  at java.lang.invoke.MemberName.makeAccessException(MemberName.java:872)
  at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:993)
  at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1379)
  at java.lang.invoke.MethodHandles$Lookup.findSpecial(MethodHandles.java:997)
  at net.orfjackal.retrolambda.lambdas.Types.toMethodHandle(Types.java:42)
  at net.orfjackal.retrolambda.lambdas.Types.asmToJdkType(Types.java:19)
  at net.orfjackal.retrolambda.lambdas.LambdaReifier.callBootstrapMethod(LambdaReifier.java:106)
  at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:37)
  ... 10 more
Caused by: java.lang.NoClassDefFoundError: android/support/v4/view/LayoutInflaterFactory
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
  at net.orfjackal.retrolambda.NonDelegatingClassLoader.loadClass(NonDelegatingClassLoader.java:25)
  at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
  at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:965)
  at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:990)
  ... 16 more
Caused by: java.lang.ClassNotFoundException: android.support.v4.view.LayoutInflaterFactory
  at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at net.orfjackal.retrolambda.NonDelegatingClassLoader.loadClass(NonDelegatingClassLoader.java:27)
  ... 29 more
:app:compileRetrolambdaDebug FAILED
:app:compileRetrolambdaDebug (Thread[main,5,main]) completed. Took 0.703 secs.

FAILURE: Build failed with an exception.

@evant
Copy link
Contributor

evant commented May 1, 2015

@shekibobo It looks like you are running into evant/gradle-retrolambda#105, unlike this issue, it can be consistently reproduced and has something to do with the latests support library. I have a workaround listed there that seems to fix it.

@Diolor
Copy link

Diolor commented May 11, 2015

I encountered the error once again.

Here is the source code (inside a method in a Activity):

public void onAttach(final Activity activity) {
    super.onAttach(activity);
    userStateUpdateAction = (UserModeAndState userModeAndState) -> {
        StateToView stateToView = new StateToView(activity, getFragmentManager());
        stateToView.loadViewForState(userModeAndState.first, userModeAndState.second);
    };
}

And this is the decompiled source code under the intermediates folder produced with the help of gradle-retrolambda:

import org.package.android.ui.BaseSupportFragment..Lambda.1;
....


public void onAttach(Activity activity) {
    this.userStateUpdateAction = 1.lambdaFactory$(this, activity);
}

the correct which should have been produced is:

import org.package.android.ui.BaseSupportFragment$$Lambda$1;
....


public void onAttach(Activity activity) {
    this.userStateUpdateAction = BaseSupportFragment$$Lambda$1.lambdaFactory$(this, activity);
}

@orfjackal could you please check?

@luontola
Copy link
Owner

@Diolor, the replacement of $ with . is most probably just a bug with the decompiler. javap should tell how it really is.

@NachoSoto
Copy link

We started hitting this issue recently as well. Somehow it's getting more frequent now.
Cleaning and rebuilding temporarily fixes the problem.

I don't think this has anything to do with the support library (at least in our case), as we're reproducing this problem in a pure-java library.

@ypresto
Copy link

ypresto commented Jun 22, 2015

I found rm -rf app/build leads to error like Caused by: java.lang.ClassNotFoundException: android.support.v4.view.LayoutInflaterFactory.
Then rebuilding succeeds without error, even after clean task has been executed.

@ypresto
Copy link

ypresto commented Jun 22, 2015

Executing task ':app:prepareComAndroidSupportSupportV132103Library' (up-to-date check took 0.001 secs) due to:
  Output file /home/ubuntu/Android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.3 has changed.
  Output file /home/ubuntu/Android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.3/jars/libs/internal_impl-21.0.3.jar has been removed.
  Output file /home/ubuntu/Android/app/build/intermediates/exploded-aar/com.android.support/support-v13/21.0.3/AndroidManifest.xml has been removed.

Workaround: run prepare***Dependencies task first, then run your build task separatedly.

./gradlew prepare${build_variant}Dependencies
./gradlew assemble${build_variant} # you can run clean before assemble

It said sometimes fails in evant/gradle-retrolambda#105.

Right workaround: run prepare***Dependencies task first, then run your build task separatedly without clean.

./gradlew clean prepare${build_variant}Dependencies
./gradlew assemble${build_variant}

@bjdupuis
Copy link

ypresto's workaround worked for my situation for my CI build. Thanks for that.

@clemp6r
Copy link

clemp6r commented Aug 17, 2015

Not sure this is relevant but the coincidence is to strong to ignore it.

I got the same problem (java.lang.NoClassDefFoundError: XXX$$Lambda$) and I noticed it always happen on the same class A after I modified a class B.

A and B are not related, except that B's name is a suffix of A's name.
ie.: a.b.FavoriteItems and a.b.Items

Recently I got the exact same problem with another pair of class, and guess what, the naming is similar, one class name is a suffix of the other class name.

As a workaround I renamed my classes so one is not a suffix of the other.

Edit: I confirm this is related to class names, I created two small classes Abcand MyAbc, with a lambda in MyAbcand the problem occurs. If I rename Abc to TheAbc, the problem is fixed.

@evant
Copy link
Contributor

evant commented Aug 17, 2015

@clemp6r Thanks! I think that lead me right to the issue. https://github.com/evant/gradle-retrolambda/blob/master/src/main/groovy/me/tatarka/RetrolambdaTask.groovy#L138 the regex for deleting the related lambda isn't quite right and deletes any lambdas with the same suffix.

@clemp6r
Copy link

clemp6r commented Aug 17, 2015

Nice!

@rspeyer
Copy link

rspeyer commented Aug 17, 2015

Awesome! This will be a great fix

@teddis
Copy link

teddis commented Aug 17, 2015

Fantastic! Thank you for discovering that. I hope this fixes it. A long, long running bug indeed!

@ypresto
Copy link

ypresto commented Aug 17, 2015

wow!!! thank you!!! i'll try that fix for incremental build after it is released. 🎉 🎉

@evant
Copy link
Contributor

evant commented Aug 17, 2015

Fixed in 3.2.2

@dhenry
Copy link

dhenry commented Aug 18, 2015

Brilliant!! Thanks for the fix!

@IlyaEremin
Copy link

@clemp6r super! Good job

@teddis
Copy link

teddis commented Aug 18, 2015

Nice sleuthing @clemp6r! This fix needs a virtual celebration.

@AlmogBaku
Copy link

My bad, I had to upgrade the gradle plugin :O

Thanks for the solution!

@monemihir
Copy link

i've just encountered this exact same issue.

i'm using retrolambda 3.6.0, gradle 2.3.0, compiled with SDK25, running on device with SDK17

seems like the issue has crept back even though it was fixed in 3.2.2

@evant
Copy link
Contributor

evant commented Mar 8, 2017

@monemihir can you open a new issue on gradle-retrolambda? I wonder if it's related to evant/gradle-retrolambda@301d176

@icaromag
Copy link

Same here! @monemihir
Also using retrolambda 3.6.0, gradle 2.3.0, compiled with SDK25.

@pcdroidski
Copy link

Having the same problem. Running an app on an Android device running Marshmallow & below causes NoClassDefFoundError crashes all over.
Retrolambda 3.6.0, Gradle 2.3.0, Android API 25.

@luisalduucin
Copy link

luisalduucin commented Apr 7, 2017

If you are using multiDex ... I solved it in this way:

In your manifest ... If you do not override the Application class then:
<application android:name="android.support.multidex.MultiDexApplication" >

If you override it, make sure that you are not extending from Application, instead you should extend from MultiDexApplication and in your manifest should be something like this :
<application android:name="yourOverridingClass" >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests