React Native Android and IPA packaging guide, with RN tips

CSS tip: vertical text

  • Set the outer container width, position the text, and set its CSS line height (lineHeight should exceed the outer text height).

iOS

  • error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening cleaaan.xcworkspace
  • Code 65 may be related to iOS package management: cd ios && pod repo update && pod install && pod update.
  • If the iOS keyboard covers the content, use the APSL component: [react-native-keyboard-aware-scrollview](https://github.com/APSL/react-native-keyboard-aware-scroll-view).

JavaScript

  • TypeError: Invalid attempt to spread non-iterable instance
  • A possible cause is assigning or converting data and objects in a way that makes them non-iterable. Check assignments between the API response and the data defined in the current state: is [...aaa] used, where aaa is the state array or object? The ... may be causing the error; try removing it.

Package a React Native iOS IPA

  • mkdir release_ios
  • npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output release_ios/main.jsbundle --assets-dest release_ios/
  • Add the files under release_ios to the Xcode project: select the project name → Add Files to the project → select release_ios → choose the folders option Create folder references → Add.
  • Add the certificate and provisioning profile, then package: Product → Archive → Distribute App. There are four choices, including iOS App Store distribution, Development testing, and Enterprise packages. Continue through the steps and export the IPA.

Package a React Native Android APK

    1. Generate a keystore.
    1. Set the Gradle variables.
    1. Add the signing configuration to the project's Gradle configuration.
    1. cd android
    1. ./gradlew assembleRelease
  • keytool -genkeypair -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

For detailed steps, see:

HTTP requests fail after installing an Android release APK

  • By default, a React Native release APK on Android 9.0 or later cannot make HTTP requests.

AndroidManifest.xml

  • Edit /当前项目名/android/app/src/main/AndroidManifest.xml and add android:usesCleartextTraffic="true" to application.
Related topics:🤖 AI × Crypto
Stay updated

Get weekly research updates, market signals, and listing intelligence — follow along on Telegram or X.