jsibbold / zoomage

A simple pinch-to-zoom ImageView library for Android
http://jsibbold.github.io/zoomage
Apache License 2.0
316 stars 77 forks source link

AAPT: error: attribute zoomage_autoResetMode not found. #117

Closed zipswich closed 1 year ago

zipswich commented 1 year ago

A library libFoo has the following in its build.gradle: api 'com.jsibbold:zoomage:1.3.1'

App appFoo uses this library in its aar form (libFoo.aar). When the app is built, Android Studio throws the following error:

AAPT: error: attribute zoomage_autoResetMode (aka com.mydomain.appfoo:zoomage_autoResetMode) not found.

Everything would be fine if the following were added to the build.gradle of appFoo: implementation 'com.jsibbold:zoomage:1.3.1' Could anyone shed some light on this?

BTW, zoomage is very handy and useful.

jsibbold commented 1 year ago

Are you publishing your libFoo aar somewhere (such as mavenLocal()) or are you using the aar file itself?

zipswich commented 1 year ago

@jsibbold I use the aar with an app by myself. The app needs that library and it is the library that uses zoomage.

jsibbold commented 1 year ago

Are you putting your aar in the app's libs directory?

zipswich commented 1 year ago

@jsibbold Yes exactly. I have gradle scripts to copy the aar to different apps' libs directories automatically at the end of the library build.

jsibbold commented 1 year ago

The issue is likely that although you're using my library as a dependency in libFoo, it's not actually being bundled into your own libFoo.aar. When libFoo is trying to use Zoomage (within your project that is using libFoo), it cannot find it unless you include it as a dependency in the build file.

zipswich commented 1 year ago

As described in my original post, libFoo has the following in its build.gradle: api 'com.jsibbold:zoomage:1.3.1'

I thought that line was sufficient for including zoomage in its bundle. Is there a better way to do it?

jsibbold commented 1 year ago

I believe that would work if you were either publishing your library to a maven repository (such as mavenLocal()) or importing your library to your other projects as a module in Android Studio, for instance, if you have your libFoo as one module, and you have your app as another module with libFoo as a dependency. This allows Gradle to pull in that dependency.

zipswich commented 1 year ago

Thank you for all the help and again for this great library.