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

Cannot inherit from final ImageSource #13

Closed
yousefArb opened this issue Jul 30, 2024 · 11 comments
Closed

Cannot inherit from final ImageSource #13

yousefArb opened this issue Jul 30, 2024 · 11 comments

Comments

@yousefArb
Copy link

Hi

Now in react native 0.75.0.rc-6 ImageSource class is final class which cannot be inherited, so I cannot use react-native-fast-image with my project.

could you fix this issue, if yes when can it be done?

thanks  

@AndrewMatsiuk
Copy link

Hi, your project in Android works correctly, where do you use FastImage ?

@yousefArb
Copy link
Author

No it's not working, Build failed because of Cannot inherit from final ImageSource error

@AndrewMatsiuk
Copy link

No it's not working, Build failed because of Cannot inherit from final ImageSource error

I understand, I have a completely different error 😃 . From what I've gathered, this library doesn't work on newer versions of React Native; iOS works, but Android doesn't work at all.

@deepanshushuklad11
Copy link
Contributor

@yousefArb I will look in to it for sure . Give me some time i will share the timelines

@YuriOlepir
Copy link

YuriOlepir commented Aug 15, 2024

Hello, after updating the react-native to 0.75.0.rc-7 I have the same error during the run yarn android

Note: Recompile with -Xlint:deprecation for details.
/app/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageSource.java:14: error: cannot inherit from final ImageSource
public class FastImageSource extends ImageSource { ^
/app/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageSource.java:72: error: isResource() in FastImageSource cannot override isResource() in ImageSource public boolean isResource() { ^ overridden method is final
/app/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageSource.java:101: error: getUri() in FastImageSource cannot override getUri() in ImageSource public Uri getUri() { ^ overridden method is final
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-fast-image:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details. * Try:
Run with --info option to get more log output.
Run with --scan to get full insights. BUILD FAILED in 41s.

@YuriOlepir
Copy link

link to the issue in the original repo DylanVann/react-native-fast-image#1043

@deepanshushuklad11
Copy link
Contributor

@YuriOlepir @yousefArb I will be picking this up

@deepanshushuklad11
Copy link
Contributor

@YuriOlepir @yousefArb facebook/react-native#46092
Meta has changed the class , now its open for inheritance , in newer release this will be fixed automatically

@Pratik-2102
Copy link

@deepanshushuklad11
Thank you for breathing new life into the old library by fixing issues and adding support for the latest React Native versions—your efforts are truly appreciated!

@Kolahzary
Copy link

It's not fixed in the newest version: "react-native": "0.75.2",

@deepanshushuklad11
Copy link
Contributor

deepanshushuklad11 commented Aug 22, 2024

It's not fixed in the newest version: "react-native": "0.75.2",

I think there was a miss in the PR a new PR has been raised to fix facebook/react-native#46152.

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