-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not load Flipper via reflection (#34383)
Summary: Followup to #34379 by danilobuerger Loading Flipper via reflection is type unsafe and requires extra code + exception handling that we can get rid of. The recommended way to use Flipper on Android is either via a `no-op` artifact or by using build flavors. As we already had a setup for Flipper for `debug`, I'm creating the `release` equivalent which is just a stub. This allows us to get rid of some code inside `MainApplication.java` ## Changelog [Android] [Changed] - Do not load Flipper via reflection Pull Request resolved: #34383 Test Plan: Will wait for a CI result on this. Reviewed By: cipolleschi Differential Revision: D38615257 Pulled By: cortinico fbshipit-source-id: 66bb2c46c5df36a15c1b27512209a849f55d64c9
- Loading branch information
1 parent
450fa4d
commit 9214da1
Showing
3 changed files
with
25 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root | ||
* directory of this source tree. | ||
*/ | ||
package com.helloworld; | ||
|
||
import android.content.Context; | ||
import com.facebook.react.ReactInstanceManager; | ||
|
||
/** | ||
* Class responsible of loading Flipper inside your React Native application. This is the release | ||
* flavor of it so it's empty as we don't want to load Flipper. | ||
*/ | ||
public class ReactNativeFlipper { | ||
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { | ||
// Do nothing as we don't want to initialize Flipper on Release. | ||
} | ||
} |