index.android.js and index.ios.js should be unified also in build.gradle and iOS build file
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: Windows 10 Node: 8.5.0 Yarn: 1.2.1 npm: 5.5.1 Watchman: Not Found Xcode: N/A Android Studio: Version 2.3.0.0 AI-162.4069837
Packages: (wanted => installed) react: 16.0.0-beta.5 => 16.0.0-beta.5 react-native: 0.49.5 => 0.49.5
Steps to Reproduce
(Write your steps here:)
- react-native init
- cd android && ./gradlew assembleRelease
Expected Behavior
Assemble release should go fine but…
Actual Behavior
I receive: Cannot find entry file index.android.js in any of the roots:
And this is because (in case of android) after the upgrade with react-native-git-upgrade, the build gradle file didn’t change and the entry file is specified as below:
* // the entry file for bundle generation
* entryFile: "index.android.js",
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:11 (2 by maintainers)
Top Results From Across the Web
React Native project do not have index.ios.js or index.android.js
For the latest version of React native(0.49.3), it seems that the "index.android.js" and "index.ios.js" separate entry routes are no longer ...
Read more >Config Plugins - Expo Documentation
Learn about config plugins, which are the Expo way of customizing the prebuild phase of an project.
Read more >Plugin Reference - NativeScript Docs
A collection of reference material for NativeScript plugin authors, including a plugin's required folder structure, npm configuration, and gradle ...
Read more >Realm: Create reactive mobile apps in a fraction of the time
Realm JavaScript enables you to efficiently write your app's model layer in a safe, persisted and fast way. It's designed to work with...
Read more >Releasing Updates - Visual Studio App Center | Microsoft Learn
ios.js or index.js ). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve found that you need both the changes to the
build.gradle
file and yourMainApplication.java
file for this to work, and it’s also important where you put these lines of code in the two files.build.gradle
Put the following in your
android/app/build.gradle
file, above the line that containsapply from: "../../node_modules/react-native/react.gradle"
Make sure you use the correct
build.gradle
file - you want the one inside theapp
folder.MainApplication.java
Put the following in your
MainApplication.java
file, which will be located inside a subdirectory tree in theandroid/app/src
folder:This needs to live inside the call to
new ReactNativeHost(this)
. Here’s an example of how it appears in my workspace:add this code inside the method “mReactNativeHost” of the MainApplication.java file. This should work 😃 @giacomocerquone
Can someone (from react native team) change this automatically when developers upgrade from older versions?