spacedev
spacedev

Reputation: 1190

React navigation in react-native v0.60 is broken

After following https://reactnavigation.org/docs/en/getting-started.html

(not using expo)

I followed the guide and disabled auto-linking by creating react-native.config.js file

But when I run react-native run-android

 error: package com.swmansion.gesturehandler.react does not exist

 error: cannot find symbol
         return new RNGestureHandlerEnabledRootView(MainActivity.this);

After this error tried adding below line in

**project/android/app/build.gradle**

 implementation project(':react-native-gesture-handler')

And cleaned gradle build and react-native run-android reset-cache

But now it says following error

error: package androidx.core.util does not exist
import androidx.core.util.Pools;

Upgrade android v4 support library to androidx

Because react-navigation-handler does not use androidX where as react-native v0.60 is completely migrated to AndroidX which says breaking change.

React navigation is dead for now...

If anyone can make this work please provide me the GitHub repo by uploading the working code with createStackNavigator

Required

React-native 0.60 latest React-navigation v3


Note: createStackNavigator uses platform conventions by default


Upvotes: 3

Views: 1412

Answers (3)

Mustafa Masvi
Mustafa Masvi

Reputation: 26

Updated to the following version

"react-native-gesture-handler": "^1.3.0",
"react-navigation": "^3.11.1"

Its working like a charm.

Upvotes: 1

LonelyCpp
LonelyCpp

Reputation: 2673

Yep react-native-gesture-handler needs to migrate to androidX

Try :

npm install --save-dev jetifier
npx jetify

https://github.com/kmagiera/react-native-gesture-handler/issues/678#issuecomment-509928220

Upvotes: 0

DNA.h
DNA.h

Reputation: 863

I am already migrated to 0.60 and I manually migrated any packages that I use to androidx, here https://github.com/DNA-h/react-native-gesture-handler is my version of recat-native-gesture-handler which is androidx compatible. You may also try @HungrySoul solution too, but sooner or later people will migrate to androidx

Upvotes: 0

Related Questions