Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blank white screen on android using react-native (release only)

My app is running fine on the emulator in debug mode. When I tried to use a signed APK on a device or run it in release mode on the emulator using:

react-native run-android --variant=release

It just gives a blank white screen and does not load.

I am using React-Native-Navigation and React-Native-Firebase, which may or may not be contributing to the issue.

One error I do see is related to Firebase I think:

W/GooglePlayServicesUtil: Google Play services out of date. Requires 11717000 but found 10298470 11-20 11:24:04.624 16106-16106/? W/FA:

That failed to send app launch certainly looks ominous.

EDIT: I am not so sure the above error is actually causing the blank white screen when running release version on my device. This message shows up in the emulator, but my app works on the emulator. On my device I see that the version of Google Play Services is 11.7.46 which I believe should work fine.

Is there anything else that would cause my app to be a blank white screen on release only?

EDIT 2:

i found another error this time (and I have since downgraded to an older version of react-native-firebase 2.2)

11-25 12:11:07.278 5281-5295/com.spectrum E/FirebaseCrash: Failed to load crash reporting com.google.android.gms.internal.mn: .com.google.android.gms.dynamite.DynamiteModule$zzc: Remote load failed. No local fallback found. at com.google.android.gms.internal.ml.zzFk(Unknown Source) at com.google.firebase.crash.zzc.zzFi(Unknown Source) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: com.google.android.gms.dynamite.DynamiteModule$zzc: Remote load failed. No local fallback found. ...

EDIT 3:

here are the dependencies from app.gradle :

dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.1"
compile "com.facebook.react:react-native:+"  // From node_modules
compile project(':react-native-navigation')

// RNFirebase required dependencies
compile(project(':react-native-firebase')) {
    transitive = false
}
compile "com.google.firebase:firebase-core:11.0.4"

// RNFirebase optional dependencies
compile "com.google.firebase:firebase-crash:11.0.4"
compile "com.google.firebase:firebase-messaging:11.0.4"

// If you are receiving Google Play API availability issues, add the     following dependency
//    compile "com.google.android.gms:play-services-base:11.0.4"

}
like image 918
Michael Campsall Avatar asked Nov 20 '17 19:11

Michael Campsall


People also ask

Why is React Native screen white?

This is because of a permission being disabled. I'm using Redmi Note which has a default permission manager which disables Display popup window permission by default. Just enable it in the app settings and it should work! Hope this helps others who are facing the same problem.

Why is my react app showing blank screen?

A blank or white screen occurs when React encounters a rendering error in a component (for example, trying to render obj. param when obj is undefined).


1 Answers

As the error says:

Google Play services out of date. Requires 11717000 but found 10298470

It means you have a different version of google play services. Im gonna assume you are using the latest firebase which is Firebase 11.6.0, but you are using Google Play Services version 10.2.9, and the version required is 11.7.1.

From the Firebase docs(in the prerequisites):

A device running Android 4.0 (Ice Cream Sandwich) or newer, and Google Play services 11.6.0 or higher

So, you either need to download the latest version of Google Play Services, or downgrade firebase in your build.gradle file

You currently have this version of firebase:

'com.google.firebase:firebase-core:11.6.0'

downgrade(maybe) to:

'com.google.firebase:firebase-core:10.2.0'

if you downgrade the firebase-core, then you have to also downgrade(in build.gradle) firebase-auth/firebase-storage/firebase-database

like image 91
Peter Haddad Avatar answered Sep 29 '22 06:09

Peter Haddad