FAQ & Troubleshooting (React Native)
Android
Picture in Picture(PIP) cannot be closed normally when killing the application in Android 11
class MainActivity: ... {
// ...
override fun onDestroy() {
super.onDestroy()
...
// Please add this line to your MainActivity
// We call FireworkSdk.closePip inside FWReactNativeSDK.INSTANCE.closePip
FWReactNativeSDK.INSTANCE.closePip()
}
}Out of JVM Memory
Gradle build daemon has been stopped: JVM garbage collector thrashing and after running out of JVM memory. Add the following configuration to the file: gradle.properties.
Gradle plugin version is larger than 4.1.x
If your Gradle plugin version is larger than com.android.tools.build:gradle:4.1.x. Please set the compileSdkVersion = 31 and targetSdkVersion = 31 . And add the following configuration to the file: src/main/AndroidManifest.xml .
Use JDK11 and Gradle 7.x.
If you want to use JDK11 and Gradle 7.x. Please do:
JAVA_HOME = JDK11 (system env)
classpath("com.android.tools.build:gradle:7.x.x") (build.gradle)
distributionUrl=https://services.gradle.org/distributions/gradle-7.x-all.zip (gradle-wrapper.properties)
And change the following configuration in the file:
app/firework.gradle.
minCompileSdk = 31
If you met the issue like below:
Please do:
Maybe your compileSdkVersion = 30 and targetSdkVersion = 30 , your Gradle is below 6.9-all and the Gradle plugin is com.android.tools.build:gradle:4.1.x .
Okhttp version issue
If you met the issue like below:
Maybe your okhttp version is 3.x.x . Please do:
Solution: force the version to your app/firework.gradle file, like below:
Glide version issue
Glide issue: if you met the issue like below:
Maybe your react-native-fast-image version is >7.x.x and <8.1.4 . Please do:
Solution 1: add the excludeAppGlideModule = true to your android/build.gradle file, like below:
Solution 2(recommended): upgrade the react-native-fast-image version to >= 8.1.4
Natively started activity is closed when launching RN app from desktop icon on Android
Please do:
Remove the
android:launchMode="singleTask"from AndroidManifest.xmlBuild a release APK or build a debug APK with bundleInDebug=true
popNativeContainer vs startFloatingPlayer
popNativeContaineris used to close the current full-screen player. We only support using this API when PiP is disabled(enablePictureInPictureisfalse).startFloatingPlayeris used to make the current full-screen player into the floating player. We only support using this API when PiP is enabled(enablePictureInPictureistrue).
Don't use popNativeContainer when PiP is enabled(enablePictureInPicture is true)
If you use popNativeContainer when PiP is enabled(enablePictureInPicture is true), it will cause inconsistent behavior between iOS and Android. This inconsistent behavior is:
No effect on iOS
The full-screen player is closed on Android
Don't use startFloatingPlayer when PiP is disabled(enablePictureInPicture is false)
If you use startFloatingPlayer when PiP is disabled(enablePictureInPicture is false), it will have no effect on iOS and Android.
How to enable PiP?
The PiP is disabled by default. You can refer to the following links to learn how to enable PiP.
Last updated
Was this helpful?