Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Build fails on android with react-native 0.57.1 #2663

Closed
3 tasks done
VilleMiekkoja opened this issue Jan 1, 2020 · 5 comments
Closed
3 tasks done

Build fails on android with react-native 0.57.1 #2663

VilleMiekkoja opened this issue Jan 1, 2020 · 5 comments
Labels
stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@VilleMiekkoja
Copy link

Bug Report

To Do First

  • Did you try latest release?
  • Did you try master?
  • Did you look for existing matching issues?

Platforms

Android

Versions

  • Android: 8.1.0
  • react-native-camera: 3.15.1
  • react-native: 0.57.1
  • react: 16.6.0-alpha.8af6728
  • react-navigation: 3.11.1

Description/Current Behaviour

Launching an application with react-native-camera@3.15.1 fails in build phase with following message:

Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED

...node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package android.support.v4.util does not exist. import android.support.v4.util.Pools;

...node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.

Expected Behaviour

Expect build to succeed, as it does when I build with react-native-camera@2.11.2.

So with version 2.11.2, it builds ok. What is weird is that this react-native-camera does not even have react-native-gesture-handler as its dependencies. Still for some reason, it fails for that if I apply the latest version of this library, and works with version 2.11.2.

Steps to Reproduce

Build react-native project for android with following dependencies:
"react": "16.6.0-alpha.8af6728",
"react-native": "^0.57.1",
"react-native-camera": "^3.15.1",
"react-native-gesture-handler": "1.0.17",
"react-navigation": "^3.11.1",

No expo used here.

@VilleMiekkoja
Copy link
Author

Tried to reverse jetify this dependency with npx jetify -r. But after that, build fails with error:

node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraView.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat

Also errors like these then appear:

node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraViewHelper.java:31: error: cannot find symbol
{"int", ExifInterface.TAG_BITS_PER_SAMPLE},

Does this mean that the library v3 does not support react-native < 60 atm?

@cristianoccazinsp
Copy link
Contributor

Are you sure you don't have any misconfiguration? android.support.v4.content.ContextCompat should be available if you're using the right code.

I would still highly recommend migrating to RN > 60. Can't help much here since I've never used the reverse jetify.

@fabOnReact
Copy link
Contributor

fabOnReact commented Jan 13, 2020

error: package android.support.v4.content does not exist

michalchudziak/react-native-geolocation#39 (comment)

cannot find symbol{"int", ExifInterface.TAG_BITS_PER_SAMPLE},

facebook/react-native#25173

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

@stale stale bot added the stale There has been a lack of activity on this issue and it may be closed soon. label Mar 13, 2020
@fabOnReact
Copy link
Contributor

react native camera supports now "react-native": "^0.59.1". I am closing the issue for now. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants