question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on starting search: java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Lkotlinx/serialization/internal/GeneratedSerializer;)V in class Lkotlinx/serialization/internal/SerialClassDescImpl

See original GitHub issue

Describe the bug 🐛

When I start search, app crashes immediately with the following stacktrace:

2020-05-08 17:46:14.375 13375-13375/com.bookcrossing.mobile E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.bookcrossing.mobile, PID: 13375
    java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Lkotlinx/serialization/internal/GeneratedSerializer;)V in class Lkotlinx/serialization/internal/SerialClassDescImpl; or its super classes (declaration of 'kotlinx.serialization.internal.SerialClassDescImpl' appears in /data/app/com.bookcrossing.mobile-B9gM-7sEV1YAj6rUbzWThA==/base.apk!classes5.dex)
        at com.algolia.search.model.APIKey$Companion.<clinit>(Unknown Source:5)
        at com.algolia.search.model.APIKey.<clinit>(Unknown Source:0)
        at com.bookcrossing.mobile.presenters.SearchPresenter.<init>(SearchPresenter.kt:56)
        at com.bookcrossing.mobile.presenters.SearchPresenter_Factory.newInstance(SearchPresenter_Factory.java:29)
        at com.bookcrossing.mobile.presenters.SearchPresenter_Factory.get(SearchPresenter_Factory.java:21)
        at com.bookcrossing.mobile.presenters.SearchPresenter_Factory.get(SearchPresenter_Factory.java:8)
        at com.bookcrossing.mobile.ui.search.SearchFragment$presenter$2.invoke(SearchFragment.kt:45)
        at com.bookcrossing.mobile.ui.search.SearchFragment$presenter$2.invoke(SearchFragment.kt:41)
        at moxy.ktx.MoxyKtxDelegate$field$1.providePresenter(MoxyKtxDelegate.kt:18)
        at moxy.MvpProcessor.getMvpPresenter(MvpProcessor.java:48)
        at moxy.MvpProcessor.getMvpPresenters(MvpProcessor.java:88)
        at moxy.MvpDelegate.onCreate(MvpDelegate.java:144)
        at moxy.MvpAppCompatFragment.onCreate(MvpAppCompatFragment.java:29)
        at androidx.fragment.app.Fragment.performCreate(Fragment.java:2684)
        at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:280)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1175)
        at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:2224)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1997)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1953)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1849)
        at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

From what I can see, there is something with APIKey serializer and how it’s bundled inside dex

You can check source code here

To Reproduce 🔍 Steps to reproduce the behavior:

  1. Open app
  2. Click on search icon
  3. See error

Expected behavior 💭 Search view should appear

Environment:

  • OS: Android 10, AGP 4.1.0-alpha09 (but checked also on 3.6.3, 4.0.0-beta03, same crash)
  • Library Version 2.3.1 (but checked also on 2.2.0, same crash)

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fobo66commented, May 13, 2020

Hello @Aallam ! Just checked with the new version, it seems to work fine. Thank you!

0reactions
Aallamcommented, May 11, 2020

Hello @fobo66,

Thank you for your reporting and contribution 😃 Version 2.4.0-beta01 deployed, please try it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you interpret "java.lang.NoSuchMethodError
This issue is happened because of Proguard is applied via Proguard this class name and methods name changes that why NoSuchMethod exception ...
Read more >
No direct method <init> at runtime (since Kotlin 1.7.10)
NoSuchMethodError : No direct method <init> at runtime (since Kotlin 1.7.10) ... I have modified a class that has parameters of the type...
Read more >
java.lang.NoSuchMethodError: No direct method <init ...
I'm guessing there's an overload of the data class constructor which adds a new argument (ILkotlin/jvm/internal/DefaultConstructorMarker;) generated at compile ...
Read more >
App crash after calling to MobileAds.initialize - Google Groups
Fatal Exception: java.lang.NoSuchMethodError. No direct method <init>(Lanq;Lanq;)V in class Lcom/google/android/gms/ads/nonagon/ad/banner/c; ...
Read more >
java.lang.NoSuchMethodError: No direct method <init>()V in ...
java.lang.NoSuchMethodError: No direct method <init>()V in class Landroid/security/IKeyChainService$Stub; or its super classes (declaration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found