Yotam
Yotam

Reputation: 21

How to make AQuery work in Android library on API 28?

I have two apps. One of them uses a library I wrote and the other one doesn't (it has the libraries code directly inside the app). The problem is that with Android Pie API 28 the images in the app that uses my library don't load. The code is the same in both apps and the image url is the same in both apps. This is the AQuery line of code used:

aq.id(imageView).image(url, true, true, size.x, R.drawable.image_place_holder);

The app with my library that doesn't work on Android Pie API 28 has the AQuery jar file in my library's lib folder and this line of code inside my library code. The image doesn't load and instead the place holder image is shown.

The app without my library has the AQuery in the app lib folder and the code directly in the app. The image loads fine and shows the place holder while loading.

I tried debugging and going to next declaration each time the values were the same. I couldn't find any problems with them.

So my question is, how can I get Aquery to work through a library with Android API 28?

EDIT: I'm trying to solve this with a work around. for this i need to either have the class with AQuery inside it, be outside of my library and from inside my library access it or to create the same class outside of my library overriding the class inside my library, so that when my library tries to use the class, it actually gets the class thats outside it. but I don't know how to override a class inside a library or use a class outside the library from inside it. I tried searching a lot and didn't find a solution. does anyone have a solution to my question or to this workaround?

EDIT: I tried taking all my library java files and moving them outside of the library and the images still don't load.

So I am still stuck on this. I can't figure out why AQuery images won't show up in one and but will in the other app. Maybe someone can point me in the direction to how I can find the error or what is causing this somehow?

Upvotes: -2

Views: 381

Answers (1)

Yotam
Yotam

Reputation: 21

found out the problem. it's not the library causing the issue, it's the targetSdkVersion being 28. When it's 27 images load, when it's 28 images don't load.

The new question is how to have AQuery load images when targeting API 28. How to make AQuery images load when targetSdkVersion is API 28?

Upvotes: 0

Related Questions