Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to eject expo to react native

I want to eject expo to bare react native cli but i can't because I am not able to enter android package name when asked. Basically when i type any android package name and hit enter it just return a blank value again.Looks like cmd is not taking input. But i degraded to expo sdk 36 from 38, then it works fine as There are different options to eject. enter image description here

like image 979
Zora Randhawa Avatar asked Jul 23 '20 15:07

Zora Randhawa


Video Answer


3 Answers

I ran into this issue as well and found out you can only use alphanumeric characters, '.' and '_', and for some reason you have to have at least one . or _ in there. So something like My.App worked for me

like image 169
twisted light Avatar answered Oct 11 '22 11:10

twisted light


i also had the same issue

Go to app.json in your react native project folder and add in

“ios”: { “bundleIdentifier”: “IOSName” },

“android”: { “package”: “AndroidName” }

and then save it and then go to your terminal and type expo eject

When it asks for Android Package Name, give the name that you have given in your app.json file for android, and similarly for ios.

Then it should work fine and finish the expo eject command.

like image 38
goutham poloth Avatar answered Oct 11 '22 09:10

goutham poloth


by default package name & versionCode for android and bundleIdentifier & buildNumber for iOS is skipped in app.json [present in root directory of your project] when you start with expo react native project...

so it is asking the package name when you expo eject.

example of package name >>> "com.yourcompany.yourappname"

so type package name as in example. Replace "com.yourcompany.yourappname" with whatever makes sense for your app.

or

go to app.json and edit manually, add missing fields for ios & android as necessary for your app and then expo eject.

{
   "expo": {
    "name": "Your App Name",
    "icon": "./path/to/your/app-icon.png",
    "version": "1.0.0",
    "slug": "your-app-slug",
    "ios": {
      "bundleIdentifier": "com.yourcompany.yourappname",
      "buildNumber": "1.0.0"
    },
    "android": {
      "package": "com.yourcompany.yourappname",
      "versionCode": 1
    }
   }
 }

Refer official docs for clear info : Expo Docs Eject

like image 39
Prem G Avatar answered Oct 11 '22 10:10

Prem G