jk-gan / redux-flipper

Redux middleware for React Native for Flipper
MIT License
159 stars 21 forks source link

Android: The native module for Flipper seems unavailable + No redux log in flipper desktop #53

Closed MohammadAzimi closed 3 years ago

MohammadAzimi commented 3 years ago

I'm using redux-toolkit + redux-persist

react-native: 0.63.4,
react-native-flipper: 0.104.0
redux-flipper: 2.0.0,

android/app/gradle

    //FLIPPER_VERSION = 0.104.0
    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

This is my store config

const persistConfig = {
  key: 'root-luna',
  version: 1,
  storage: AsyncStorage,
  whitelist: ['userState'],
};

const persistedReducer = persistReducer(persistConfig, rootReducer);
const middlewares = [];

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

export const store = configureStore({
  reducer: persistedReducer,
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
      },
    }).concat(middlewares),
  devTools: __DEV__,
  // preloadedState,
  // enhancers: [reduxBatch],
});
export const persistor = persistStore(store);

I wanted to see redux logs in flipper so I add redux-flipper to my project. and flipper-plugin-redux-debugger 2.0.0 in flipper desktop (windows) and the status color is green. Then I received errors about missing react-native-flipper; so I installed it too. But now I'm having 2 issues:

plwai commented 3 years ago

@MohammadAzimi Does flipper able to connect to your application?

MohammadAzimi commented 3 years ago

@plwai yes it does

plwai commented 3 years ago

Did you try this? https://github.com/facebook/flipper/issues/1253

MohammadAzimi commented 3 years ago

https://github.com/facebook/flipper/issues/1253#issuecomment-663423999 This one helped me. I had changed android package name 🤦‍♂️