Change App Name In React Native

2020-05-11 11:29发布

I'm trying to figure out how to change a ReactNative app name. The installed APK on my device is simply "App", with the Android icon. How can I change this?

I've tried changing package.json and re-running react-native upgrade but it didn't update AndroidManifest.xml

13条回答
相关推荐>>
2楼-- · 2020-05-11 11:46

simply change <string name="app_name"> 'NEW_APP_NAME' </string> located in

[project_dir]/android/app/src/main/res/values/strings.xml

NOTE: recommended

react-native-rename

by Paul Nyondo maybe affect MainApplication.java file, DON'T USE IT!

查看更多
来,给爷笑一个
3楼-- · 2020-05-11 11:49

Simply way

PROJECT >android > app > main > res > style

Then change the app name

查看更多
Lonely孤独者°
4楼-- · 2020-05-11 11:50

If you are asking only for Android here is solution

Modify displayName in /app.json file

Modify app_name in android/app/src/main/res/values/strings.xml

then Run these commands one by one

cd android
gradlew clean
cd ..
react-native run-android
查看更多
一夜七次
5楼-- · 2020-05-11 11:50

You can try this

  1. Update displayName in app.json to the new name
  2. Delete ios/ and android/ directories
  3. Run react-native eject
  4. Run react-native link
查看更多
smile是对你的礼貌
6楼-- · 2020-05-11 11:51

Try react-native-rename this npm package will ease the process

// install react-native rename

   npm install react-native-rename -g
   or 
   yarn global add react-native-rename

// in project directory

   react-native-rename <New_Project_ Name>
查看更多
Root(大扎)
7楼-- · 2020-05-11 11:54

The generator does not override the strings.xml file located in android/app/src/main/res/values/, so you have to change the app_name variable manually

查看更多
登录 后发表回答