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

java.lang.IllegalAccessException RenderingProblems #29

Closed
nextkaki opened this issue Aug 4, 2016 · 15 comments
Closed

java.lang.IllegalAccessException RenderingProblems #29

nextkaki opened this issue Aug 4, 2016 · 15 comments

Comments

@nextkaki
Copy link

nextkaki commented Aug 4, 2016

Xml File Set Inner
<com.woxthebox.draglistview.DragListView
android:id="@+id/lv_academy"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Error Content

Rendering Problems
java.lang.IllegalAccessException: Class com.android.layoutlib.bridge.util.ReflectionUtils can not access a member of class com.woxthebox.draglistview.DragItemRecyclerView with modifiers "public"   at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)   at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)   at java.lang.reflect.Method.invoke(Method.java:490)   at com.android.layoutlib.bridge.util.ReflectionUtils.invoke(ReflectionUtils.java:45)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setProperty(RecyclerViewUtil.java:126)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setProperty(RecyclerViewUtil.java:120)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setLayoutManager(RecyclerViewUtil.java:78)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setAdapter(RecyclerViewUtil.java:59)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)   at android.view.LayoutInflater.inflate(LayoutInflater.java:423)   at com.woxthebox.draglistview.DragListView.createRecyclerView   ... (DragListView.java:131)   at com.woxthebox.draglistview.DragListView.onFinishInflate(DragListView.java:94)

Maybe private or Protectd -> public change?

@abe-shek
Copy link

abe-shek commented Aug 5, 2016

This is something similar to what I am facing. Would really appreciate some or any help regarding the same.

@woxblom
Copy link
Owner

woxblom commented Aug 5, 2016

Hm this feels like a proguard problem. Have you added a rule like it it written in the readme?

I'm on vacation now so I can be at bit slow to answer.

@abe-shek
Copy link

abe-shek commented Aug 5, 2016

Hey, sorry to bug you over on your vacation, but as it seems I did add the proguard rules earlier only.

@woxblom
Copy link
Owner

woxblom commented Aug 5, 2016

Hm ok. Could you please make a small test app where the crash is reproducible and mail it to me and I will investigate it.

woxthebox@gmail.com

@abe-shek
Copy link

abe-shek commented Aug 6, 2016

No, it's not like the app is crashing but more like the dragList is not updating with any values, none whatsoever.
I have the dragListView as a child to a FrameLayout, which itself is a child in a hierarchy of Layouts.
But, even is I use the DragList widget to define a seldom list under a single parent Layout, it gives the same "rendering error", displaying nothing but the default(/custom) background set for the app theme.

@woxblom
Copy link
Owner

woxblom commented Aug 6, 2016

Ok, it is hard for me to figure put what the problem is without a test app to debug. So please make a test app with the same layout structure and same problem and mail me and I will check it out.

@abe-shek
Copy link

abe-shek commented Aug 6, 2016

Ok, I got it to work. I omitted a key method while creating the itemAdapter and it wasn't linking to the current(or any) item.
Thanks for your time though, and apologies for causing trouble whilst on your vacation. :)

@nghiavkht
Copy link

I got same problem, Android studio could not render xml file in the preview area, code is still built and run as well.
This also happens in Demo project.
Wish you have great vacation!

@woxblom
Copy link
Owner

woxblom commented Aug 7, 2016

Ok, so it is only in the preview area you have a problem now? Building and running the app works fine?

@nextkaki
Copy link
Author

nextkaki commented Aug 8, 2016

I am English for beginners.
Yes. it is only in the preview area Rendering Problems. Ok?

  1. Building Ok. Redering Problems It is still.
  2. Building and running app Ok. Rendering Problems It is still.
  3. It is possible to run normally. then. Preview Rendering Problems +
    Preview API 23, Automatically No Check,

Now do you simply need to send an application?(Google Translate)

@abe-shek
Copy link

abe-shek commented Aug 8, 2016

Yeah, the preview area is the problem and honestly it doesn't matter. The app works just fine!

@woxblom
Copy link
Owner

woxblom commented Aug 9, 2016

Ok, I will look into the preview area when I get home from vacation.

@woxblom
Copy link
Owner

woxblom commented Aug 19, 2016

I looked into the problem and even if I change the DragItemRecyclerView to public I run into other reflection problems with the preview area.

java.lang.reflect.InvocationTargetException   at java.lang.reflect.Method.invoke(Method.java:497)   at com.android.layoutlib.bridge.util.ReflectionUtils.invoke(ReflectionUtils.java:45)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setProperty(RecyclerViewUtil.java:126)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setProperty(RecyclerViewUtil.java:120)   at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setAdapter(RecyclerViewUtil.java:62)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)   at android.view.LayoutInflater.inflate(LayoutInflater.java:495)   at android.view.LayoutInflater.inflate(LayoutInflater.java:426)   at com.woxthebox.draglistview.DragListView.createRecyclerView   ... (DragListView.java:131)   at com.woxthebox.draglistview.DragListView.onFinishInflate(DragListView.java:94)

It is when they try to setup the adapter "setProperty(recyclerView, CN_ADAPTER, adapter, "setAdapter");" which the problem arises. I guess it is because I subclass the RecyclerView. I don't really know how to fix this problem.
Also since this is just a preview area problem I don't see it as a critical bug. I will be closing this bug now and if anyone wants to help to dig into the problem please do! :)

@woxblom woxblom closed this as completed Aug 19, 2016
@nextkaki
Copy link
Author

Who do you finding a bug?

@woxblom
Copy link
Owner

woxblom commented Aug 22, 2016

Hum I don't understand you question.

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

No branches or pull requests

4 participants