File not found: index.android.js in any of the project roots - React Native Navigation production packaging

1.9k Views Asked by At

My app runs on React Native Navigation v1.0 and react-native v0.56.0. This runs pretty well on Android simulator without any trouble.

Recently, I was planning to make a production build following the steps as described at ReactNative page.

At the time of generating the release APK with ./gradlew assembleRelease command, eventually I've thrown by the error - File not found: index.android.js in any of the project roots; But my project consists of index.js not index.android.js.

This is less possible to get a help at Wix Git since they gives less attention to v1.0 nowadays. So, I'm hoping for an way out here.

Here is my MainApplication.java contents:

import android.support.annotation.Nullable;

import com.facebook.react.ReactPackage;
import com.reactnativenavigation.NavigationApplication;

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

import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.oblador.vectoricons.VectorIconsPackage;

public class MainApplication extends NavigationApplication {
    @Override
    public boolean isDebug() {
        return BuildConfig.DEBUG;
    }

    @Nullable
    @Override
    public List<ReactPackage> createAdditionalReactPackages() {
        return Arrays.<ReactPackage>asList(
            new PickerPackage(),
            new VectorIconsPackage()
        );
    }

    @Nullable
    @Override
    public String getJSMainModuleName() {
        return "index";
    }
}

Please help.

Thanks!

1

There are 1 best solutions below

0
On

It looks like I able to continue after adding the following line to /android/app/build.gradle file at top:

project.ext.react = [
    entryFile: "index.js"
]

The above line was not there before, and I don't know if adding only this is adequate - I moved from throwing that index.android.js error, but stuck somewhere else now; At least this looks like adding that line not throwing me the index.android.js error anymore.