Change package name for Android in React Native

后端 未结 20 1800
鱼传尺愫
鱼传尺愫 2020-11-30 16:13

I used react-native init MyApp to initialise a new React Native app. This created among others an Android project with the package com.myapp.

相关标签:
20条回答
  • 2020-11-30 17:03

    Go to file android/app/src/main/AndroidManifest.xml -

    Update :

    attr android:label of Element application as :

    Old value - android:label="@string/app_name"

    New Value - android:label="(string you want to put)"

    and

    attr android:label of Element activity as :

    Old value - android:label="@string/app_name"

    New Value - android:label="(string you want to put)"

    Worked for me, hopefully it will help.

    0 讨论(0)
  • 2020-11-30 17:04

    You can use react-native-rename package which will take of all the necessary changes of package name under

    app/mainapplication.java

    AndroidManifest.xml

    but make sure to manually change the package name of all files under the java/com folder. because when i created an splash screen activity the old package name is not updated.

    https://www.npmjs.com/package/react-native-rename

    0 讨论(0)
提交回复
热议问题