-
Notifications
You must be signed in to change notification settings - Fork 25.1k
React Native has several bugs on linux android... #11024
Description
Description
I'm a react developer and some days ago I've started with react-native framework. Following the getting start page, I faced a lot of bugs.
After that, I found some errors. Searching for a solution on the web, I landed on a stackoverflow page that instructs several steps in order to solve these issues. It's required to create an "assets" folder within the path "MyProject/android/app/src/main/" and run bash commands.
Reproduction
The bugs appear when I run "react-native run-android" after all environment set up.
The first one was related to the platform API, I had to change manually to android API 23.0.1.
The second one is a common bug that says "Could not get BatchedBridge".
Solution
These are the steps for a possible solution:
-
Change the file "MyProject/android/app/build.gradle". Add the correct Android API supported version.
Under "dependencies" section I had to add the line
"compile "com.android.support:appcompat-v7:23.0.1" -
Create an "assets" folder under the "MyProject/android/app/src/main/"
-
On terminal run the following commands..
react-native start > /dev/null 2>&1 &
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
(cd android/ && ./gradlew assembleDebug)
sometimes it's required run npm start.
Actually, I loved the framework, but the documentation lacks that bug solutions and becomes the development work pain.
Additional Information
- react-native-cli: 1.2.0
- react-native: 0.37.0
- Platform: Android API 23.0.1
- Operating System: Linux Elementary 8 (Ubuntu LTS based)