Giter Site home page Giter Site logo

Comments (7)

prithvibhola avatar prithvibhola commented on May 22, 2024 1

Hey @vbuberen,

The issue is coming because of setting the LayoutManager in the XML. The files are obfuscated and LayoutManager is not set properly.

<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    app:layoutManager="LinearLayoutManager"
    tools:context="com.chuckerteam.chucker.api.internal.ui.transaction.TransactionListFragment"
    tools:listitem="@layout/chucker_list_item_transaction" />

Quick Fix:
For now, I have included this rule in the proguard file

-keep class androidx.recyclerview.widget.** { *; }

Also, the issue can be fixed if LayoutManager is removed from the XML file and is set within the Java/Kotlin code.

from chucker.

vbuberen avatar vbuberen commented on May 22, 2024

Hey @prithvibhola
Wanted to make sure that you used Chucker with ProGuard on purpose, not just in release production app.

As to the issue itself - interesting. I will try to reproduce it and in case of success might work on rules to include into the library.

from chucker.

autonomousapps avatar autonomousapps commented on May 22, 2024

I had a similar issue with proguard:

12-12 13:24:24.910 16525-16525/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.star, PID: 16525
java.lang.NoSuchMethodError: No direct method (Landroid/content/Context;Lcom/chuckerteam/chucker/api/ChuckerCollector;JLjava/util/Set;ILkotlin/o/d/g;)V in class Lc/a/a/a/a; or its super classes (declaration of ‘c.a.a.a.a’ appears in /data/app/com.hiya.star-1/base.apk)”

Something to do with the overloaded constructor

from chucker.

vbuberen avatar vbuberen commented on May 22, 2024

@prithvibhola
Thanks for getting back and providing details.
However, I have never seen such issue before on other projects I work on as a daily job. Both ProGuard and R8 always worked well and respected layout managers set from XML.

Anyway, I will take a look considering your info. Probably, some consumer rules might be included into a library package as other libs often have.

from chucker.

prithvibhola avatar prithvibhola commented on May 22, 2024

@vbuberen

From the crash logs
Caused by: java.lang.ClassNotFoundException: Didn't find class "dark.LinearLayoutManager" on path

-repackageclasses "dark" might be the reason that I was getting this issue. It repackages all class files and moves them into the single given package.

from chucker.

vbuberen avatar vbuberen commented on May 22, 2024

@prithvibhola
Now it makes sense. Your -repackageclasses "dark" breaks the build, since LinearLayoutManager class is placed in androidx.recyclerview.widget.LinearLayoutManager package.

Also, note that on latest stable version of Chucker, which is 3.0.1 at the moment, there is no such issue, so feel free to rollback for a little bit till @cortinico gets back from his vacation and releases a new version.

As to your solution - I would still stick to LayoutManager being set in xml file rather than code.
And I have a solution which would work for your case. Will create a PR shortly.

from chucker.

vbuberen avatar vbuberen commented on May 22, 2024

@autonomousapps
Hey there. It seems that your issue is slightly different from the one originally reported by the author of this issue. Would you mind creating a new issue with more details about your problem?
Like version of Chucker used, the error itself (as reported here) etc.

from chucker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.