Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: A runtime version is set in your AndroidManifest.xml, but is missing from your app.json/app.config.js #116

Closed
km1chno opened this issue Sep 19, 2024 · 2 comments · Fixed by #120
Assignees
Labels
🪲 bug Something isn't working

Comments

@km1chno
Copy link
Collaborator

km1chno commented Sep 19, 2024

Sometimes when running expo prebuild in project with android directory, we get the following error:

image

So far it has only been observed in CNG projects with android directory left as junk after build.

Quick remedy could be to

It would be nice to understand exactly what the issue is though

@km1chno km1chno added the 🪲 bug Something isn't working label Sep 19, 2024
@km1chno km1chno self-assigned this Sep 20, 2024
@km1chno
Copy link
Collaborator Author

km1chno commented Sep 20, 2024

Steps to reproduce:

  1. Set up expo project with app.json which has no runtimePolicy field and android/ directory in .gitignore.
  2. Run setup-ci --preset --eas.
  3. Run npx expo prebuild.
  4. Run git reset --hard HEAD; git clean -df.
  5. Run setup-ci --preset --eas again.
  6. error occurs

Root cause

EAS Preview recipe patches app.json by adding

runtimeVersion: {
    policy: "fingerprint"
}

After that, npx expo prebuild (step 3) produces android/app/src/main/AndroidManifest.xml file with the following line:
<meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="@string/expo_runtime_version"/>.
This line is added to AndroidManifest.xml by expo prebuild only if runtimeVersion is defined in app.json.

Then, if we reset app.json to original state (step 4.), and runtimeVersion field is removed), the android directory is not removed since it is listed in .gitignore and running npx expo prebuild again (as a subprocess of step 5) results in the error.

@km1chno
Copy link
Collaborator Author

km1chno commented Sep 20, 2024

I will close this with #120 as this seems like a very rare edge case that should not be handled by us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant