X-Guard / react-native-flic2

Use Flic 2 within your React Native application with ease.
Other
8 stars 9 forks source link

Flic2 fails to work with `gradle 7.0.1` #28

Closed punndcoder28 closed 1 year ago

punndcoder28 commented 2 years ago

Flic2 fails to build with gradle 7.0.1 mainly due to it still using maven which has been removed in the latest gradle. We cannot downgrade our gradle version since another dependency requires it to be the latest. Is there any workaround for this? Need to use this library for an important project integration. Any help from the developers would be appreciated. Thanks!

Edit 1: Adding the exact error message for better understanding

* What went wrong:
A problem occurred evaluating project ':react-native-flic2'.
> Plugin with id 'maven' not found.
jdegger commented 2 years ago

I'm confused, we recently updated to maven as jcenter was not supported by gradle anymore.

Are you on the latest version of this plugin?

In our latest commit we fixed the jcenter dependency and switched to maven. https://github.com/X-Guard/react-native-flic2/commit/ec93b6e7a62488833b047fd58e43bc0a932959dc

jdegger commented 2 years ago

More info here https://github.com/X-Guard/react-native-flic2/issues/27

punndcoder28 commented 2 years ago

We are using the latest gradle version 7.x . As mentioned here maven has been removed in the latest version

jdegger commented 2 years ago

In the same changelog it says you can still use private maven repos (like jitpack as used by flic2)

https://docs.gradle.org/7.0/userguide/upgrading_version_6.html#jcenter_deprecation

If this is is really an issue, we need to escalate to the Flic team as they provide the library:

https://github.com/50ButtonsEach/flic2lib-android#flic2-lib-for-android

Also see last issue about this in the flic repo: https://github.com/50ButtonsEach/flic2lib-android/issues/17

jdegger commented 2 years ago

Are you on the newest version of react-native-flic2?

https://jitpack.io/#50ButtonsEach/flic2lib-android

Also has no mention of any changes to the syntax for any gradle version

punndcoder28 commented 2 years ago

Sorry I am confused now. The file does specify plugin as maven-publish but react-native-flic2's repo here still uses maven. Maybe this is causing an issue and the root repository is correct. I do not have a lot of experience developing libraries and publishing them so I might be wrong 😀

jdegger commented 2 years ago

We do not publish anything, we only download from Flic through maven+jitpack which should work fine.

I will close this issue as I believe at this point there is nothing wrong with the code. It should work fine. Please let me know if you are on the last version and it still does not work. You do need the latest version of this plugin for it to work. I'm still not sure you are on the last version as you have not answered the question above.

punndcoder28 commented 2 years ago

By plugin do you mean the version of maven?

jdegger commented 2 years ago

I think I understand the issue, however this is not an issue with our plugin but with the library. You might want to open an issue here (https://github.com/50ButtonsEach/flic2lib-android/issues).

I still think it should not matter as the build is done by jitpack but I might be mistaken.

You need react-native-flic2@0.3.18 at least

punndcoder28 commented 2 years ago

This is the content in our package.json "react-native-flic2": "^0.3.18"

I believe we are using the latest version of the library

jdegger commented 2 years ago

Alright, that's good. I will reopen this for others to see the problem. I believe Flic2 should resolve this if the issue persists.

punndcoder28 commented 2 years ago

I will open an issue with the native library and discuss possible fixes for the same. Thanks!

punndcoder28 commented 2 years ago

@jdegger Could you try updating your react-native-flic2 to use maven-publish instead of maven and try releasing a version. I would've created a PR but I have no experience doing this change.

Here : https://github.com/X-Guard/react-native-flic2/blob/master/android/build.gradle#L23

jdegger commented 2 years ago

You can edit the source code locally in node_modules/react-native-flic2 and then rebuild. If it works we can change it 👍

punndcoder28 commented 2 years ago

Can you walk me through the process of changing it. I haven't done anything similar in the past

LucasMonteiro1 commented 2 years ago

This issue is solved with https://github.com/X-Guard/react-native-flic2/pull/30

MalikHassan512 commented 1 year ago

Flic2 fails to build with gradle 7.0.1 mainly due to it still using maven which has been removed in the latest gradle. We cannot downgrade our gradle version since another dependency requires it to be the latest. Is there any workaround for this? Need to use this library for an important project integration. Any help from the developers would be appreciated. Thanks!

Edit 1: Adding the exact error message for better understanding

* What went wrong:
A problem occurred evaluating project ':react-native-flic2'.
> Plugin with id 'maven' not found.

Add this line below of apply plugin: 'com.android.library' this in react-native-flic2 build.gradle

apply plugin: 'maven-publish'

it will look like this

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
wesdewitte commented 1 year ago

Try latest version