Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Android app white screen won't start

I get the following error log when I run my Android app: http://pastebin.com/1jHEfdQ3 The app sometimes crashes in the simulator but most of the time it just displays a white screen. I can console.log one or two things until the app won't respond. R-R to refresh doesn't work. None of the dev tools work. I'm stumped with what to do at this point.

I'm running react native 0.38.0

EDIT:

I've tried cleaning my gradle and deleting and reinstalling my node modules.

One thing to note is that I am using React Native Navigation which means I had to modify MainApplication and MainActivity to the following:

MainActivity:

package com.prayerrequest;

import com.facebook.react.ReactActivity;
import com.reactnativenavigation.NavigationApplication;
import com.airbnb.android.react.maps.MapsPackage;
import com.cmcewen.blurview.BlurViewPackage;
import io.realm.react.RealmReactPackage;
import com.reactnativenavigation.controllers.SplashActivity;


public class MainActivity extends SplashActivity {

}

MainApplication:

package com.prayerrequest;

import com.facebook.react.ReactPackage;

import com.cmcewen.blurview.BlurViewPackage;
import io.realm.react.RealmReactPackage;
import com.airbnb.android.react.maps.MapsPackage;

import com.reactnativenavigation.NavigationApplication;

import java.util.Arrays;
import java.util.List;

  public class MainApplication extends NavigationApplication {
    @Override
     public boolean isDebug() {
         // Make sure you are using BuildConfig from your own application
         return BuildConfig.DEBUG;
     }

     @Override
     public List<ReactPackage> createAdditionalReactPackages() {
        return Arrays.<ReactPackage>asList(
          new RealmReactPackage(),
          new BlurViewPackage(),
          new MapsPackage()
        );
     }
  }

I've crossposted on React Native's issues page here

like image 380
Daniel van der Merwe Avatar asked Oct 29 '22 12:10

Daniel van der Merwe


2 Answers

The issue seems to be 'Couldn't load memtrack module (No such file or directory)'

It looks like there's an issue with the simulator.

This is a config of my fully functional simulator: enter image description here

Lots of other suggestions can be found here:

Couldn't load memtrack module Logcat Error

like image 77
Florin Dobre Avatar answered Nov 02 '22 22:11

Florin Dobre


I had a similar problem. I would get this white screen when trying to get it to run on device.

The problem was when I would do adb devices or react-native run-android I would get "ADB is Not Recognized as an internal or external command".

So my fix was to add the path to adb.exe's parent directory to my Environment Variables and then restart my command prompts.I then ran react-native run-android and on startup no more red screen showing the completely useless error message Error calling AppRegistry.runApplication! :)

So I found ADB was located in my folder:

C:\Users\dell\AppData\Local\Android\sdk\platform-tools\adb.exe I am on a Windows 10 system. dell is my user name of the computer.

So I went to System Environment Variables then found "Path" then clicked "Edit", then clicked "New" and added in "C:\Users\dell\AppData\Local\Android\sdk\platform-tools".

like image 31
Manuj Vashist Avatar answered Nov 02 '22 22:11

Manuj Vashist