Create-react-native-app: Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package"

Created on 24 Mar 2017  ·  13Comments  ·  Source: expo/create-react-native-app

Description

Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package"

Expected Behavior

git clone my personal project: https://github.com/kenpeter/osmosis_seek_android
run exp build:android
Expect it build successfully.

Observed Behavior

git clone my personal project: https://github.com/kenpeter/osmosis_seek_android
run exp build:android

Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package"

More detail here: Detail here: https://stackoverflow.com/questions/42967465/created-an-app-with-create-react-native-app-how-to-publish-it-to-the-google-pla

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts:

[email protected] /var/www/html/test/testme/seekandroid
├── UNMET PEER DEPENDENCY [email protected]
└── [email protected]

npm ERR! peer dep missing: [email protected], required by [email protected]

  • npm ls react-native:

[email protected] /var/www/html/test/testme/seekandroid
└── UNMET PEER DEPENDENCY [email protected]

npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! code 1

  • npm ls expo:

├── [email protected]
└── UNMET PEER DEPENDENCY [email protected]

npm ERR! peer dep missing: [email protected], required by [email protected]

  • node -v:

v6.10.0

  • npm -v:

3.10.10

  • yarn --version:

0.21.3

  • watchman version:
    none

Also specify:

  1. Operating system: ubuntu 16.04, 64 bit

  2. Phone/emulator/simulator & version: nexus 6p or emulator

Reproducible Demo

https://github.com/kenpeter/osmosis_seek_android

Most helpful comment

Check if your app.json is look like this:
```
{
"expo": {
"name": "Your App Name",
"icon": "./path/to/your/app-icon.png",
"version": "1.0.0",
"slug": "your-app-slug",
"sdkVersion": "17.0.0",
"ios": {
"bundleIdentifier": "com.yourcompany.yourappname"
},
"android": {
"package": "com.yourcompany.yourappname"
}
}
}

All 13 comments

Hi! Thanks for the detailed report! The issue here appears to be that your project has both app.json and expo.json files, which aren't correctly merged right now. If you delete app.json, building your project should work.

Since this is an issue with the exp tool, I've opened an issue there: https://github.com/exponent/exp/issues/41, and am closing this one.

Also, if you delete app.json, you'll also need to rename expo.json to exp.json, I believe.

Got similar issue:
Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package"
with
node: v8.5.0
npm: 5.3.0
expo: 19.0.1

I have only app.json in my project. Not have exp.json/expo.json.
Can anyone please help me regarding this.

Check if your app.json is look like this:
```
{
"expo": {
"name": "Your App Name",
"icon": "./path/to/your/app-icon.png",
"version": "1.0.0",
"slug": "your-app-slug",
"sdkVersion": "17.0.0",
"ios": {
"bundleIdentifier": "com.yourcompany.yourappname"
},
"android": {
"package": "com.yourcompany.yourappname"
}
}
}

@freundallein I'm having the same issue and my app.json has the exact same structure as you provided. Same order, the only changes are the values.

same problem here
' Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package" '

@figitaki, it's strange, because i had the same issue and solve it after check my braces be like:
{ "expo": { "android": { "package": "anything" } } }

i am having the same exact structure, dont know why it cant find the android package name

On the same stage :( Can anyone give a thought?

here's an example of a valid android package in app.json https://github.com/brentvatne/growler-prowler/blob/master/app.json

Maybe the build error was related to versionCode line that's why it caused a build issue. I've just tried to delete this record then rebuild again, however this error [exp] Cannot start new build, as there is a build in progress. still appears.

 "android": {
      "package": "com.cleanme.cleanme",
      "versionCode": "16.8"  
    }

i change this code:

    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.T.RS"
    },
    "android": {
      "package": "com.T.RS"
    }

to this code:

    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.yourcompany.yourappname"
    },
    "android": {
      "package": "com.yourcompany.yourappname"
    }

the problem solved to me

for anyone else having the same issue I solved it by moving the "android" portion in app.json inside "expo" key.

Was this page helpful?
0 / 5 - 0 ratings