android build failed, android.package

In the last two days I keep having problems building an apk with eas.
app.json

{
	"expo": {
		"name": "Harvest Tests",
		"slug": "harvest-tests",
		"version": "1.0.0",
		"assetBundlePatterns": ["**/*"],
		"ios": {
			"bundleIdentifier": "com.timudev.harvesttests"
		},
		"android": {
			"package": "com.timudev.harvesttests",
			"adaptiveIcon": {
				"foregroundImage": "./assets/adaptive-icon.png",
				"backgroundColor": "#FFFFFF"
			},
			"permissions": [
				"CAMERA",
				"FOREGROUND_SERVICE",
				"READ_EXTERNAL_STORAGE",
				"WRITE_EXTERNAL_STORAGE",
				"INTERNET"
			]
		},
		"extra": {
			"eas": {
				"projectId": "9b419543-3010-4065-b222-9cef26fece05"
			}
		}
	}
}

app.config.js

export default ({ config }) => {
	return Object.assign(config, {
		runtimeVersion: {
			policy: 'sdkVersion',
		},
		updates: {
			url: 'https://u.expo.dev/9b419543-3010-4065-b222-9cef26fece05',
			enabled: true,
			fallbackToCacheTimeout: 0,
			checkAutomatically: 'ON_ERROR_RECOVERY',
		},
		splash: {
			image: './assets/splashn.png',
			resizeMode: 'contain',
			backgroundColor: '#203543',
		},
		extra: {
			internalVersion: '1.0.0',
			eas: {
				projectId: '9b419543-3010-4065-b222-9cef26fece05',
			},
		},
	});
};

Before, I’ve no problem when I do eas build -p android --profile preview

But in the last two days it fails saying:
[stderr]

CommandError: Input is required, but 'npx expo' is in non-interactive mode.

[stderr]

Project must have a `android.package` set in the Expo config (app.json or app.config.js).
Error: Unknown error. See logs for more information.

It appears no to be reading all the config files, now in Read app config only appears this:

Using app configuration:

2

{
  "name": "harvest-tests",
  "slug": "harvest-tests",
  "version": "1.0.0",
  "sdkVersion": "47.0.0",
  "platforms": [
    "ios",
    "android"
  ],
  "currentFullName": "@timudev/harvest-tests",
  "originalFullName": "@timudev/harvest-tests"
}

and not the rest, I think something must have changed in how to configure these files, any ideas?

thanks

Hi @timudev

That’s strange. I’ve just tried building an app with the above app.json and app.config.js and it worked fine. I only changed the name, slug, update URL, splash image, package, bundle ID and projectId. The build succeeds and the “Read app config” section includes all of the expected info.

This was with eas-cli version 3.0.0.

Although your symptoms still wouldn’t make sense to me if this were the case, is there a chance you have one of those files in .gitignore? Or do you have the app in a monorepo?

EDIT: I see there was an update to eas-cli that tries to add channel info to eas.json. Are you running eas-cli version 3.1.0? Maybe it was trying to do that and it couldn’t do that in non-interactive mode? Just a guess.

I’ve upgraded to eas-cli 3.1.0 and the “app config” shown on the build page is still as expected. :man_shrugging:

Hi, thanks a lot. That was it, I have the files in my .gitignore, and because of the expo project ID, I’ve added. Thanks a lot for the reply.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.