expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
772 stars 81 forks source link

EAS Local Android Build Fails with "expo-camera" dependency #2476

Closed krystianhub closed 5 days ago

krystianhub commented 1 month ago

Build/Submit details page URL

No response

Summary

Local Android builds with EAS fail when I include the "expo-camera" dependency in my new project. This issue did not occur yesterday.

If you remove "expo-camera" from the NPM dependencies, the build succeeds. Strangely, nothing in the project has changed in the last 24 hours.

Managed or bare?

Managed

Environment

expo-env-info 1.2.0 environment info: System: OS: Linux 6.9 Fedora Linux 40 (Toolbx Container Image) Shell: 3.7.0 - /usr/bin/fish Binaries: Node: 20.16.0 - ~/.local/share/mise/installs/node/20/bin/node npm: 10.8.1 - ~/.local/share/mise/installs/node/20/bin/npm SDKs: Android SDK: API Levels: 33, 34 Build Tools: 30.0.3, 33.0.0, 33.0.1, 34.0.0 System Images: android-34 | Intel x86_64 Atom npmPackages: expo: ~51.0.24 => 51.0.24 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.74.3 => 0.74.3 npmGlobalPackages: eas-cli: 10.2.1 Expo Workflow: managed

----

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check npm/ yarn versions ✔ Check for issues with metro config ✔ Check for legacy global CLI installed locally ✔ Check that native modules do not use incompatible support packages ✔ Check that packages match versions required by installed Expo SDK ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Error output

[RUN_GRADLEW] FAILURE: Build failed with an exception. [RUN_GRADLEW] * What went wrong: [RUN_GRADLEW] Execution failed for task ':app:checkDebugDuplicateClasses'. [RUN_GRADLEW] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable [RUN_GRADLEW] > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.12.0.aar -> core-1.12.0-runtime (androidx.core:core:1.12.0) and support-compat-25.3.1.aar -> support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)

Reproducible demo or steps to reproduce from a blank project

krystianhub commented 1 month ago

As a side note, EAS cloud builds also fail in the same manner.

vonkanehoffen commented 1 month ago

I'm getting similar errors to the above too. Weird thing is I started noticing the checkDebugDuplicateClasses on local builds today with no reference to expo-camera, eg,

[RUN_GRADLEW] Execution failed for task ':app:checkDebugDuplicateClasses'.
[RUN_GRADLEW] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
[RUN_GRADLEW]    > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.12.0.aar -> core-1.12.0-runtime (androidx.core:core:1.12.0) and support-compat-25.3.1.aar -> support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
[RUN_GRADLEW]      Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.12.0.aar -> core-1.12.0-runtime (androidx.core:core:1.12.0) and support-compat-25.3.1.aar -> support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
...

I then tried on a cloud build with my repo at the exact same commit that passed last week, and it errored, this time with references to expo-camera:

Execution failed for task ':expo-camera:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
...

Could something have changed in some upstream dependency I wonder?

if anyone from Expo's reading this and wants to see full logs:

vonkanehoffen commented 1 month ago

@krystianhub I managed to fix this by switching from npm to yarn classic. No idea why this sorted it, but it did 😁 Hope that helps

szdziedzic commented 1 month ago

Hi,

I used your repro steps and the build worked for me.

In your successful build in the expo doctor logs I see:

Detailed check results:
The following packages should be updated for best compatibility with the installed expo version:
  @sentry/react-native@5.26.0 - expected version: ~5.22.0
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
One or more checks failed, indicating possible issues with the project.
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

Command "expo doctor" failed.
npx -y expo-doctor exited with non-zero code: 1

However for the failed build I see that:

Detailed check results:
The following packages should be updated for best compatibility with the installed expo version:
  @sentry/react-native@5.26.0 - expected version: ~5.22.0
  expo@51.0.22 - expected version: ~51.0.24
  expo-dev-client@4.0.20 - expected version: ~4.0.21
  expo-router@3.5.18 - expected version: ~3.5.20
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
One or more checks failed, indicating possible issues with the project.
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

Command "expo doctor" failed.
npx -y expo-doctor exited with non-zero code: 1

Can you try to do npx expo install --check?

krystianhub commented 1 month ago

I retried the same build with no changes whatsoever since yesterday and everything suddenly works again... EAS local & cloud builds.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 5 days ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.