gabrielemariotti / cardslib

Android Library to build a UI Card
4.66k stars 1.19k forks source link

Using android studio 3.1 no longer works cardslib. #568

Open druidamix opened 6 years ago

druidamix commented 6 years ago

I can't no longer use android.enableAapt2=false.

Any intention to patch the library to make it compatible?

Thanks.

max32002 commented 6 years ago

just WARNING, don't worry about it.

WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.

teristam commented 6 years ago

It's not just a warning. In Android Studio 3.1, the project fails to compile with android.enableAapt2=false.

druidamix commented 6 years ago

Next year android.enableAapt2=false won't work. I'm replacing with recycle-view with cursorloader. cardlib, as it is now won't work anymore. Uses a customer recycle-view.

metaphyze commented 6 years ago

I'd like to second this request: Any intention to patch the library to make it compatible?

I'd like to continue using this great library. Thanks.

ajburley commented 5 years ago

enableAapt2 was removed from the later versions of Android Studio / Gradle plugin. It's ignored, so AAPT2 is always used regardless of this option.

There is no official patch but this patch is helpful: oplarshad/cardslib@ef39a99ef827802db488ad2203e742ca58053696

zeldomar commented 4 years ago

enableAapt2 was removed from the later versions of Android Studio / Gradle plugin. It's ignored, so AAPT2 is always used regardless of this option.

There is no official patch but this patch is helpful: oplarshad/cardslib@ef39a99

Hi,

Can you please explain to me how to use this fork of the cardslib project (including this patch) ? Should I modify the dependencies of my projects? With what ?

Thank you in advance

ajburley commented 3 years ago

enableAapt2 was removed from the later versions of Android Studio / Gradle plugin. It's ignored, so AAPT2 is always used regardless of this option. There is no official patch but this patch is helpful: oplarshad/cardslib@ef39a99

Hi,

Can you please explain to me how to use this fork of the cardslib project (including this patch) ? Should I modify the dependencies of my projects? With what ?

Thank you in advance

I just manually applied the diffs from that patch to my local copy of vanilla cardslib. The changes are to fix the compiler errors which you get with AAPT2. This will allow the project to build with AAPT2.

Also, not all the changes from that commit are even required. Lots of the changes are actually to remove redundant code, which is a good thing, but not essential for this task of making it work with AAPT2.

Changed files where the changes are NOT only to remove redundant code are:

The key changes are ForegroundLinearLayout.java and attrs.xml. The others are just to upgrade various versions.

zeldomar commented 3 years ago

I just manually applied the diffs from that patch to my local copy of vanilla cardslib

Thanks for the reply, it gives me hope for my application :)

It is this part which is precisely the problem for me, how do you do that, please?

Do you have a link to a page explaining how to fork an android project, modify it locally, and reuse it in another local project? Or simpler: can you please publish your patched version to Maven Central?

Thank you in advance

ajburley commented 3 years ago

@zeldomar Here's a brief summary...

Clone the code from github into a folder (e.g. "cardslib") under your root Gradle project

Modify your local settings.gradle like this (replacing YourApp with your app-level Gradle project):

include ':YourApp', ':library', ':library-extra'
project(':library').projectDir = new File('cardslib/library')
project(':library-extra').projectDir = new File('cardslib/library-extra')

Add the dependency to your app-level build.gradle like this:

implementation project(':library')
implementation project(':library-extra')

Then just manually apply the diffs which I mentioned from GitHub to the cloned code.

I apologise if this is still not clear to you, I don't have the capacity to provide more detail than that, maybe you can ask on some forums like StackOverflow etc if things are still not clear.

zeldomar commented 3 years ago

@zeldomar Here's a brief summary...

@ajburley It's worked, thank you so so much !