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

Using android studio 3.1 no longer works cardslib. #568

Open
druidamix opened this issue Mar 27, 2018 · 10 comments
Open

Using android studio 3.1 no longer works cardslib. #568

druidamix opened this issue Mar 27, 2018 · 10 comments

Comments

@druidamix
Copy link

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

Any intention to patch the library to make it compatible?

Thanks.

@max32002
Copy link

max32002 commented Apr 3, 2018

just WARNING, don't worry about it.

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

@teristam
Copy link

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

@druidamix
Copy link
Author

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
Copy link

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
Copy link

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

@zeldomar
Copy link

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
Copy link

ajburley commented Jan 17, 2021

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:

  • /build.gradle
  • /demo/extras/build.gradle
  • /demo/stock/build.gradle
  • /extra/extra-dragdrop/build.gradle
  • /extra/extra-staggeredgrid/build.gradle
  • /extra/extra-twoway/build.gradle
  • /gradle/wrapper/gradle-wrapper.properties
  • /library-cards/build.gradle
  • /library-core/build.gradle
  • /library-core/src/main/AndroidManifest.xml
  • /library-core/src/main/java/it/gmariotti/cardslib/library/view/ForegroundLinearLayout.java
  • /library-core/src/main/res/values/attrs.xml
  • /library-recyclerview/build.gradle

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

@zeldomar
Copy link

zeldomar commented Apr 25, 2021

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
Copy link

@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
Copy link

zeldomar commented May 15, 2021

@zeldomar Here's a brief summary...

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

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

6 participants