facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.31k stars 954 forks source link

The flipper app does not show the app #4544

Open lannyf77 opened 1 year ago

lannyf77 commented 1 year ago

upgrade to 0.182.0 from 0.95, the app does not show got error in log.

Deprecation notice: [conn] RSockets are being deprecated at Flipper. Please, use the latest Flipper client in your app to migrate to WebSockets. App: 

Anything needs to change for working with 0.182.0?

dependency:

    debugImplementation 'com.facebook.flipper:flipper:0.182.0'
    debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.182.0'
    debugImplementation 'com.facebook.soloader:soloader:0.10.4'
    releaseImplementation 'com.facebook.flipper:flipper-noop:0.182.0'

code for set the fbflipperInterceptor

       if (com.facebook.flipper.android.utils.FlipperUtils.shouldEnableFlipper(context)) {
            com.facebook.soloader.SoLoader.init(context, false)
            val networkPlugin = NetworkFlipperPlugin()
            val client: FlipperClient = AndroidFlipperClient.getInstance(context)
            client.addPlugin(InspectorFlipperPlugin(context, com.facebook.flipper.plugins.inspector.DescriptorMapping.withDefaults()))
            client.addPlugin(networkPlugin)
            client.start()
            fbflipperInterceptor = FlipperOkhttpInterceptor(networkPlugin)

            val interceptors: MutableList<Interceptor> = ArrayList()
            fbflipperInterceptor?.let {
                interceptors.add(it)
            }

            val builder = OkHttpClient.Builder()
                 .readTimeout(60, TimeUnit.SECONDS)
                 .connectTimeout(60, TimeUnit.SECONDS)
                 .writeTimeout(10, TimeUnit.MINUTES)
                 .retryOnConnectionFailure(true)

            for (interceptor in interceptors) {
                builder.addInterceptor(interceptor!!)
            }

            val logging = HttpLoggingInterceptor()
            logging.setLevel(HttpLoggingInterceptor.Level.BODY)
            builder.addInterceptor(logging);
            return builder.build()
        }

image

same code with 0.95 dependencies and Flipper app it works fine:

    debugImplementation "com.facebook.flipper:flipper:0.95.0"
    debugImplementation "com.facebook.flipper:flipper-network-plugin:0.95.0"
    debugImplementation "com.facebook.soloader:soloader:0.10.1"

the httpClient is used with Retrofit later:

Retrofit.Builder()
                .baseUrl(endPoint)
                .addConverterFactory(GsonConverterFactory.create())
                .client(httpClient)
                .build()

image

By the way can Flipper app 0.182.0 and 0.95.0 work side by side?

talyh commented 1 year ago

This seems to be a regression. Downgrading to https://github.com/facebook/flipper/releases/tag/v0.179.0 worked for me

lannyf77 commented 1 year ago

This seems to be a regression. Downgrading to https://github.com/facebook/flipper/releases/tag/v0.179.0 worked for me

Thanks talyh. Tried with 0.179.0 but it shows the same error and no app.

passy commented 1 year ago

By the way can Flipper app 0.182.0 and 0.95.0 work side by side?

No, that is not supported. We switched from RSocket to WebSocket as communication mechanism.