Comments (8)
@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.
@alaegin , doesn't work with this rules too
from viewbindingpropertydelegate.
@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.
Will be fixed in 1.4.3
from viewbindingpropertydelegate.
@kirich1409 , on last release (1.4.4) still doesn't works.
To fix it i remove "allowshrinking" from proguard rules.
from viewbindingpropertydelegate.
@Anton111111 , please send your crash log?
from viewbindingpropertydelegate.
@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.
Will be fixed in the next release
from viewbindingpropertydelegate.
Related Issues (20)
- Can give a sample of how to use RecyclerView.ViewHolder? HOT 1
- IllegalStateException: Fragment's view can't be accessed. HOT 6
- IllegalStateException FragmentViewBindingProperty.getLifecycleOwner HOT 1
- UnresolvedReference HOT 2
- Crash on language change HOT 7
- Android Studio Dolphin | 2021.3.1 does not show layout preview HOT 2
- IllegalStateException: Fragment's view can't be accessed. Fragment isn't added. - when trying to restore fragment state HOT 1
- Kkk
- Custom views are crashing preview after updating Android Studio up to Dolphin HOT 1
- Hgf
- Version 1.5.8 onwards causes error in RecyclerView HOT 1
- NoClassDefFoundError HOT 1
- Clear happens after onViewCreated HOT 3
- Generic type cannot be used HOT 5
- how to use 'noreflection:1.5.6' in this case? HOT 3
- Random crash when navigating between fragments back and forth. HOT 3
- Is it possible to provide support for viewBinding(ViewBinding::inflate) HOT 2
- java.lang.IllegalStateException: Fragment's view can't be accessed HOT 1
- Fatal Exception: java.lang.IllegalStateException: Host view isn't ready. LifecycleViewBindingProperty.isViewInitialized return false HOT 1
- How to correctly use a generic? View blank and onViewCreated() not called in Fragment nor Base HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viewbindingpropertydelegate.