Coder Social home page Coder Social logo

Comments (8)

alaegin avatar alaegin commented on September 7, 2024 1

@Anton111111 Try to add this rule to your proguard config.
It seems that the original distribution lucks of some rules.

-keep class * implements androidx.viewbinding.ViewBinding {
  public static *** bind(android.view.View);
  public static *** inflate(android.view.LayoutInflater);
  public static *** inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean);
}

from viewbindingpropertydelegate.

Anton111111 avatar Anton111111 commented on September 7, 2024 1

@alaegin , doesn't work with this rules too

from viewbindingpropertydelegate.

Anton111111 avatar Anton111111 commented on September 7, 2024 1

@kirich1409 , @alaegin ,i've fixed my problem with small tuned of @alaegin advice.
I expanded the advice by adding a line: "public static *** inflate(android.view.LayoutInflater, android.view.ViewGroup);"

My complet proguard rule:

-keep class * implements androidx.viewbinding.ViewBinding {
public static *** bind(android.view.View);
public static *** inflate(android.view.LayoutInflater);
public static *** inflate(android.view.LayoutInflater, android.view.ViewGroup);
public static *** inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean);
}

from viewbindingpropertydelegate.

kirich1409 avatar kirich1409 commented on September 7, 2024 1

Will be fixed in 1.4.3

from viewbindingpropertydelegate.

Anton111111 avatar Anton111111 commented on September 7, 2024 1

@kirich1409 , on last release (1.4.4) still doesn't works.
To fix it i remove "allowshrinking" from proguard rules.

from viewbindingpropertydelegate.

kirich1409 avatar kirich1409 commented on September 7, 2024

@Anton111111 , please send your crash log?

from viewbindingpropertydelegate.

Anton111111 avatar Anton111111 commented on September 7, 2024

@kirich1409 ,i get the following exception on the sample (to check sample see first message):
2021-02-21 11:09:32.132 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.anton111111.navigation, PID: 7283 android.view.InflateException: Binary XML file line #9 in com.anton111111.navigation:layout/auth_fragment: Binary XML file line #9 in com.anton111111.navigation:layout/auth_fragment: Error inflating class com.anton111111.navigation.ui.CustomView Caused by: android.view.InflateException: Binary XML file line #9 in com.anton111111.navigation:layout/auth_fragment: Error inflating class com.anton111111.navigation.ui.CustomView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:852) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.inflate(LayoutInflater.java:680) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at androidx.fragment.app.Fragment.l0(:1922) at androidx.fragment.app.Fragment.L0(:2950) at b.k.b.s.f(:515) at b.k.b.s.m(:282) at b.k.b.m.Z(:2177) at b.k.b.m.T0(:2094) at b.k.b.m.W(:1990) at b.k.b.m$g.run(:524) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) Caused by: java.lang.NoSuchMethodException: com.anton111111.navigation.databinding.CustomViewBinding.inflate [class android.view.LayoutInflater, class android.view.ViewGroup] at java.lang.Class.getMethod(Class.java:2072) at java.lang.Class.getMethod(Class.java:1693) at c.a.a.h.f.a(:60) at c.a.a.h.e.b(:21) at c.a.a.f$b.a(:37) at c.a.a.f$b.j(Unknown Source:2) at c.a.a.d.b(:33) at c.a.a.d.a(:25) at com.anton111111.navigation.ui.CustomView.getViewBinding(Unknown Source:7) at com.anton111111.navigation.ui.CustomView.a(:38) at com.anton111111.navigation.ui.CustomView.<init>(:30) at com.anton111111.navigation.ui.CustomView.<init>(:20) at com.anton111111.navigation.ui.CustomView.<init>(:19) at java.lang.reflect.Constructor.newInstance0(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:343)  at android.view.LayoutInflater.createView(LayoutInflater.java:852)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)  at android.view.LayoutInflater.inflate(LayoutInflater.java:680)  at android.view.LayoutInflater.inflate(LayoutInflater.java:532)  at androidx.fragment.app.Fragment.l0(:1922)  at androidx.fragment.app.Fragment.L0(:2950)  at b.k.b.s.f(:515)  at b.k.b.s.m(:282)  at b.k.b.m.Z(:2177)  at b.k.b.m.T0(:2094)  at b.k.b.m.W(:1990)  at b.k.b.m$g.run(:524)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:223)  at android.app.ActivityThread.main(ActivityThread.java:7656)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

from viewbindingpropertydelegate.

kirich1409 avatar kirich1409 commented on September 7, 2024

Will be fixed in the next release

from viewbindingpropertydelegate.

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.