score:-1
just try to generate apk from android studio. it is the best and the most stable way. you can find lots of articles about generating apk from android studio.
if you still want to generate apk from command line here is the command to run:
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && rm -rf android/app/src/main/res/drawable-* && cd android && ./gradlew assemblerelease
if you need a more detailed article: https://www.instamobile.io/android-development/generate-react-native-release-build-android/
score:0
i am new to react-native and i use expo. if you are new to app react-native development, try installing expo and letting them handle the build process.
how to install expo onto existing react-native project: https://jablog.online/blog/2020/01/22/existing-react-native-project-on-expo/
score:0
the problem solved by using ./gradlew assembleerelease
command.
score:1
you have to clean the gradle first then run the command ./gradlew bundlerelease
otherwise use following command into your project directory.
1. cd android && ./gradlew clean
2. cd ..
3. npx react-native run-android --variant=release
Source: stackoverflow.com
Related Query
- React Native - Build successful but no APK output
- React Native release build crash issue, but on debug it is working fine
- How to build debug apk in react native
- react native ios build succeeds but path to app bundle is wrong
- react js compilation is successful but no output
- React Native on Android failed to find Build Tools
- React Native error: Element type is invalid: expected a string or a class/function but got: object
- React Native 0.64 won't build iOS app after updating Xcode to 12.5 and iOS to 14.5
- Why does my React Native app build successfully despite TypeScript compiler error?
- React native build error: Attempt to invoke virtual method'boolean com.facebook.react.uimanager.FabricViewStateManager.hasStateWrappper()
- React Native build failed in android, @react-native-community/cli-platform-android /native_modules.gradle' line: 130
- React Native build failed: 'React/RCTBridge.h' file not found
- combine react build output into single js file
- React native Refresh works but next call still uses the last token
- How to build react native project to aar library?
- React Native Android: Static Image is not showing in production released apk
- React Native Project Running from Xcode but not from command line
- "You require appropriate loaders", Using react native and expo. App fails to compile on the web, but runs on android
- The React App works during `npm start` but returns 404 after build
- React Native app works when run from Xcode, but crashes when run with 'react-native run-ios'
- react native app works on debug mode, but not works release mode on ios
- React Native Element type is invalid expected a string but got undefined
- How to create a debug apk in react native expo
- React Native dev build on device expires?
- React styled component causes build error in production, but runs fine in development
- React Native Firebase auth().signInWithPhoneNumber() return unexpected error in Release APK
- The app build fails when using React Native CLI
- Where is console.log output when running app on android real device in react native
- React Native android build FAILD :app:mergeReleaseResources
- React Native - How to Build an Image Grid like FaceBook
More Query from same tag
- How to add user mention to message using reactjs?
- iterating through an array and performing a function
- Implement imperial units on React Mapbox
- Protected Routes React Router 4 not working with auth state stored in Redux
- Where do I fetch initial data from server in a React Redux app?
- React multiple mappings on same level key-prop-problem
- Using modal to add a new data to mui-datatable
- How to POST new data via Ajax on React JS
- Chaining promises including fetch
- Routes not rendering with react-router-dom
- Why is my element under another element while the second element doesn't have a z-index?
- Where is my memory leak coming from? useEffect in React
- Add elements to a list that belongs to a state using react
- Single quote in tsx file with prettier
- Uncaught Error: Cannot add node 1 because a node with that id is already in the Store
- How do I pass a useState function into a component from context?
- Responsive Images in Bootstrap 5 with Given Layout
- Generic component with default type
- How would I wrap a div that is repeating in a .map method
- Error: Invariant failed: You should not use <Link> outside a <Router>
- How to have Babel in Webpack ignore .less files
- Tailwind CSS how to style a href links in React?
- Conditional show/hide for react radio button in .map
- Recursive function in Redux/Thunk returning Promise object, not regular object
- Import SVG icons from another folder
- Does the Provider in useContext hold more than one value
- React child component not executing functional parent component function
- conditional rendering nested ifs react
- Right way to use JWT auth token in React Redux app
- Jest test (ReferenceError: google is not defined) ReactJS and Google Charts