expo / eas-cli

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

Could not set unknown property 'classifier' for task ':expo-firebase-core:androidSourcesJar' of type org.gradle.api.tasks.bundling.Jar. #2134

Open mensafri opened 7 months ago

mensafri commented 7 months ago

Build/Submit details page URL

https://expo.dev/accounts/mensafri/projects/rs-unimus/builds/f3f82e89-2b58-46e1-92a7-89f4393b1087#run-gradlew

Summary

cant build my react native with eas build -p android --profile preview

but can run in my emulator

this is my package.json

{ "name": "sim-rs-unimus", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, "dependencies": { "@expo-google-fonts/montserrat": "^0.2.3", "@react-native-async-storage/async-storage": "1.18.2", "@react-native-community/datetimepicker": "7.2.0", "@react-native-community/viewpager": "^5.0.11", "@react-native-firebase/app": "^18.6.1", "@react-native-picker/picker": "2.4.10", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", "@react-navigation/native-stack": "^6.9.16", "@react-navigation/stack": "^6.3.20", "axios": "^1.6.1", "date-fns": "^2.30.0", "expo": "~49.0.15", "expo-app-loading": "^2.1.1", "expo-firebase-core": "^6.0.0", "expo-firebase-recaptcha": "^2.3.1", "expo-font": "~11.4.0", "expo-image": "~1.3.5", "expo-permissions": "~14.2.1", "expo-radio-button": "^1.0.8", "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", "firebase": "^10.5.0", "patch-package": "^8.0.0", "react": "18.2.0", "react-native": "0.72.6", "react-native-datepicker": "^1.7.2", "react-native-dropdown-picker": "^5.4.6", "react-native-gesture-handler": "~2.12.0", "react-native-pager-view": "6.2.0", "react-native-popover-view": "^5.1.8", "react-native-safe-area-context": "4.6.3", "react-native-screens": "~3.22.0", "react-native-svg": "13.9.0", "react-native-webview": "13.2.2", "expo-build-properties": "~0.8.3" }, "overrides": { "@expo/config-plugins": "~7.2.2", "@expo/prebuild-config": "~6.2.4" }, "devDependencies": { "@babel/core": "^7.20.0" }, "private": true }

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.22621 Binaries: Node: 18.15.0 - D:\NodeJS\node.EXE npm: 9.8.1 - D:\NodeJS\npm.CMD IDEs: Android Studio: AI-212.5712.43.2112.8815526 npmPackages: expo: ~49.0.15 => 49.0.16 react: 18.2.0 => 18.2.0 react-native: 0.72.6 => 0.72.6 Expo Workflow: managed

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

Didn't find any issues with the project!

Error output

FAILURE: Build completed with 2 failures. 1: Task failed with an exception.

Reproducible demo or steps to reproduce from a blank project

This should be reproducible via the steps below, but this behavior is currently being exhibiting in a private repository)

  1. npx create-expo-app my-app
  2. npx expo install expo-firebase-core
  3. eas build -p android --profile preview
TheeAnon commented 7 months ago

When installing expo-firebase-core": "^6.0.0", it installs or uses @expo/config-plugins@5.0.4 as it's dependency,, this is what causes the error. I'm also stuck there. Someone help😣

EmadNaguiDarwish commented 7 months ago

same here

TheeAnon commented 7 months ago

@EmadNaguiDarwish are you using firebase recaptcha?

TheeAnon commented 7 months ago

@mensafri and @EmadNaguiDarwish remove firebase recaptcha and firebase core then use custom firebase recaptcha patch. This one https://github.com/maksof-sarwar/expo-firebase-recaptcha-patch

That's how I solved mine🙂

SongMinQQ commented 7 months ago

I have same error. But error message is different. my build error message is 'Gradle build failed with unknown error'

SongMinQQ commented 7 months ago

@mensafri and @EmadNaguiDarwish remove firebase recaptcha and firebase core then use custom firebase recaptcha patch. This one https://github.com/maksof-sarwar/expo-firebase-recaptcha-patch

That's how I solved mine🙂

It's not installed. why? err log is

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: finding@1.0.0
npm ERR! Found: react-native@0.72.5
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.72.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.72.7" from @itzsunny/firebase-login@0.0.7
npm ERR! node_modules/@itzsunny/firebase-login
npm ERR!   dev @itzsunny/firebase-login@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\koe73\AppData\Local\npm-cache\_logs\2023-12-05T03_01_31_092Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\koe73\AppData\Local\npm-cache\_logs\2023-12-05T03_01_31_092Z-debug-0.log
EmadNaguiDarwish commented 7 months ago

I can't install the patch also

solheimsolutions commented 7 months ago

"The expo-firebase-analytics and expo-firebase-recaptcha packages allowed the use of some Firebase features on Classic Builds, Expo Go, and Expo for Web, but developers often encountered version conflicts when trying to use them alongside the rest of the Firebase suite. With EAS Build and development builds, it is much easier to use React Native Firebase directly in your entire development workflow, so these expo-firebase-* packages have been deprecated and will be removed in SDK 48."

https://github.com/expo/fyi/blob/main/firebase-migration-guide.md

CagriUysal commented 7 months ago

@solheimsolutions answer solved the issue for me. Looks like expo-firebase-recaptcha causes problems during development buildings. It was all fine while making developments with expo go.

Durotemy commented 5 months ago

Hello @CagriUysal , @mensafri and all i am having the same issue

A problem occurred evaluating project ':expo-splash-screen'.

Could not set unknown property 'classifier' for task ':expo-splash-screen:androidSourcesJar' of type org.gradle.api.tasks.bundling.Jar

what do i do?

luccahora commented 5 months ago

Hello @CagriUysal , @mensafri and all i am having the same issue

A problem occurred evaluating project ':expo-splash-screen'.

Could not set unknown property 'classifier' for task ':expo-splash-screen:androidSourcesJar' of type org.gradle.api.tasks.bundling.Jar

what do i do?

I was having the same problem. I updated the expo-splash-screen

Durotemy commented 5 months ago

@luccahora this works thanks so much. i also have another problem on another app when i tried to build via eas build -platform ios

Error: Compatible versions of some pods could not be resolved. You are seeing this error because either:

can u pls help me

gtarun8341 commented 3 months ago

Running 'gradlew :app:bundleRelease' in /home/expo/workingdir/build/android Downloading https://services.gradle.org/distributions/gradle-8.3-all.zip 10 %. 20%. 30%. 40%. 50%. 60 %. 70%. 80% 90%. 100% Welcome to Gradle 8.3! Here are the highlights of this release:

ChatGPT It seems like there are two main errors in your Gradle build process:

The first error occurred while evaluating the project :expo-constants. It seems to be related to setting the property classifier for the task expo-constants:androidSourcesJar. This could be due to a misconfiguration or a compatibility issue with Gradle 8.3. To troubleshoot this, you can try running the Gradle build with the --stacktrace option to get a detailed stack trace, which might give more insight into the specific cause of this issue.

The second error occurred while configuring the project :expo. It mentions an unknown property release for the SoftwareComponent container. This could be another compatibility issue with Gradle 8.3 or a misconfiguration in the ExpoModulesCorePlugin.gradle script. Similarly, you can run the Gradle build with the --stacktrace option to get more details about this error.

To address these issues:

Check the compatibility of the libraries and plugins you are using with Gradle 8.3. You might need to update some of them to versions that are compatible with Gradle 8.3.

Review the relevant configuration files (build.gradle, ExpoModulesCorePlugin.gradle, etc.) and ensure that there are no typos or incorrect configurations, especially related to the properties mentioned in the error messages.

If possible, try rolling back to an earlier version of Gradle to see if the build succeeds with that version. This can help isolate whether the issues are specific to Gradle 8.3.

Consult the documentation or community forums for the libraries and plugins you are using to see if there are any known issues or workarounds for compatibility with Gradle 8.3.

By following these steps and debugging the specific errors indicated in the logs, you should be able to resolve the Gradle build failures.

Message ChatGPT…

ChatGPT can make mistakes. Consider checking important information.

gtarun8341 commented 3 months ago

Can some one solve

rahuldasgupta commented 2 months ago

any fix yet?

Martyneris commented 3 weeks ago

Hello @CagriUysal , @mensafri and all i am having the same issue A problem occurred evaluating project ':expo-splash-screen'.

Could not set unknown property 'classifier' for task ':expo-splash-screen:androidSourcesJar' of type org.gradle.api.tasks.bundling.Jar

what do i do?

I was having the same problem. I updated the expo-splash-screen

I was having the exact same issue, updating the expo-splash-screen helped me too.