flipper: The native module for Flipper seems unavailable. Please verify that `react-native-flipper` is installed

🐛 Bug Report

I have updated React Native from v0.61.4 to v0.62.2 to try and use Flipper.

When I build and run the app The Metro Bundler throws the warning:

The native module for Flipper seems unavailable. Please verify that react-native-flipper is installed as yarn dependency to your project and, for iOS, that pod install is run in the ios directory.

I have installed it using npm.

My package.json looks like this:

  "dependencies": {
    "react": "16.13.1",
    "react-native": "0.62.2",
    "react-native-flipper": "^0.45.0",
    "react-redux": "^7.1.3",
    "redux": "^4.0.4",
    "redux-flipper": "^1.2.0",
    "redux-thunk": "^2.3.0",
 ...

In Flipper, React DevTools can connect to the app but when I try to use the Hermes Debugger or plugins they cannot be used:

enter image description here enter image description here

When I run this: adb shell am start -n com.app/com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity

I get this error:

Error type 3 Error: Activity class {com.app/com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity} does not exist.

What could be the reason for the modules not installing correctly?

To Reproduce

Environment

“react”: “16.13.1”, “react-native”: “0.62.2”, “react-native-flipper”: “^0.45.0”, Mac OSX 10.14 Android 10, physical Pixel 2XL

Update

So I created a new React Native app just to see if I could get Flipper working and I could but without the redux-flipper plug-in. I also got Hermes debugger working. If I remove all reference and use of the redux-flipper plug in, I don’t get the warning anymore saying that is can’t find the package because I am not using this code in the redux store anymore:

// if (__DEV__) {
//   const createDebugger = require('redux-flipper').default;
//   middlewares.push(createDebugger());
// }

I do however get this error in Flipper developer tools console opened from the view menu:

Error: Feature not implemented
    at getUser (bundle.js:597)
    at e.default (bundle.js:2281)
    at bundle.js:1577
    at Array.map (<anonymous>)
    at _default (bundle.js:1577)
    at bundle.js:3
    at Object.rehydrate (bundle.js:707)
    at _rehydrate (bundle.js:699)
    at bundle.js:699

I also don’t get any of these options in the left hand side of Flipper (databases, images etc): Screenshot 2020-06-13 at 19 15 28

I am not using devTools v3 and a I keep having to do adb reverse.

Flipper still only connects to the device, not the app.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 35 (11 by maintainers)

Most upvoted comments

I had the same problem, for me, directory structure in debug folder wasn’t the same as in the main folder so it couldn’t find it, check your folder structure and check this line: Class<?> aClass = Class.forName("YOUR_PACKAGE_NAME.ReactNativeFlipper");

I am just dropping this reply if somebody has the same problem 😃

I found the culprit. Package identifier in ReactNativeFlipper.java was com.rndiffapp and I didn’t notice it. Everything works now, thank you for the help 😃

Might be quite obsolete, but didn’t find this here. The problem with iOS is related to the autolinking not being able to find the Podspec (not sure why). So what worked for me is directly specifying the path in Podfile. I added this line: pod 'react-native-flipper', path: '../node_modules/react-native-flipper'.

I found myself not being careful on renaming the package name. Here is some advice for those who facing this problem when changing package name.

image
  1. Make sure both debug and main have the same directory in order for ReactNativeFlipper.java to work.
image
  1. Make sure in MainApplication.java, initializeFlipper() method have the correct class path.
image
  1. Make sure all the top-level package have the same package name.

Hope this helps someone out there save you from hours of rebuilding

I am using the Redux Tool Kit “@reduxjs/toolkit”: “^1.8.1”, “react-native”: “0.64.3”,

This is my store

import { configureStore } from '@reduxjs/toolkit'
import personalAccount from './personalAccount/personalAccountSlice'

const middlewares = []

if (__DEV__) {
  const createDebugger = require('redux-flipper').default
  middlewares.push(createDebugger())
}

export const store = configureStore({
  reducer: {
    personalAccount
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware().concat(middlewares)
})

export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatch

And when I open the application appears the same problema that “The native module for Flipper seems unavailable. Please verify that react-native-flipper is installed as yarn dependency to your project and, for iOS, that pod install is run in the ios directory.”

I already did pod install and did not work something.

@jakubgrzelak hitting the exact same issue after upgrading to 0.69.1 same exact versions as you.

I have created a MRE here, displaying the issue, the warning also causes flipper plugins such as redux-debugger to also not work.

Could we reopen this?

I also accidentally placed ReactNativeFlipper.java into main android folder, not debug (android/app/src/debug/java/com/rndiffapp/ReactNativeFlipper.java).

Might be quite obsolete, but didn’t find this here. The problem with iOS is related to the autolinking not being able to find the Podspec (not sure why). So what worked for me is directly specifying the path in Podfile. I added this line: pod 'react-native-flipper', path: '../node_modules/react-native-flipper'.

Worked for me! Thanks!

@dawidvdh That fix doesn’t work for me as the file in question doesn’t exist.

Having upgraded to XCode 14 I’m seeing the above error using Flipper 0.164.0 and RN 0.63.4.

@Epick362 / @TheAlmightyBob, ok, it looks that Flipper isn’t actually initialized on your app, the warning you get is a sympton of that, but probably not the original cause. Could you verify that the class com.edocu.pris.ReactNativeFlipper indeed does exist and whether there are any errors logged in the device logs?

@Epick362 / @TheAlmightyBob just to verify, you did run cd android && ./gradlew clean after finishing the upgrade?

@passy / @jknoxville any further input on this? There are now several reports than on Android specifically the Flipper client doesn’t connect, any further ideas? At least the diagnostic utility seems to crash in both cases as well.