eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

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

Open mensafri opened this issue 2 years ago • 20 comments

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.

  • Where: Build file '/home/expo/workingdir/build/node_modules/expo-firebase-core/android/build.gradle' line: 40
  • What went wrong: A problem occurred evaluating project ':expo-firebase-core'.

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

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception.


  • What went wrong: A problem occurred configuring project ':expo'.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.

Run with --info or --debug option to get more log output.

Run with --scan to get full insights. ==============================================================================

  • Get more help at https://help.gradle.org BUILD FAILED in 1m 57s 5 actionable tasks: 5 executed Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

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

mensafri avatar Nov 25 '23 09:11 mensafri

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

TheeAnon avatar Nov 30 '23 14:11 TheeAnon

same here

EmadNaguiDarwish avatar Dec 04 '23 00:12 EmadNaguiDarwish

@EmadNaguiDarwish are you using firebase recaptcha?

TheeAnon avatar Dec 04 '23 05:12 TheeAnon

@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🙂

TheeAnon avatar Dec 04 '23 05:12 TheeAnon

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

SongMinQQ avatar Dec 05 '23 00:12 SongMinQQ

@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: [email protected]
npm ERR! Found: [email protected]
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/[email protected]
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

SongMinQQ avatar Dec 05 '23 03:12 SongMinQQ

I can't install the patch also

EmadNaguiDarwish avatar Dec 06 '23 23:12 EmadNaguiDarwish

"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

solheimsolutions avatar Dec 12 '23 07:12 solheimsolutions

@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.

CagriUysal avatar Dec 17 '23 13:12 CagriUysal

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?

Durotemy avatar Feb 12 '24 18:02 Durotemy

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

luccahora avatar Feb 13 '24 16:02 luccahora

@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:

  • Some of the pods used in your project depend on different versions of the same pod. See logs for more information.
  • If you are caching Podfile.lock using "cache" field in eas.json, then versions there might not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with "--clear-cache" option, or select "Clear cache and retry build" on the build page. Screen Shot 2024-02-12 at 5 29 58 PM

can u pls help me

Durotemy avatar Feb 13 '24 20:02 Durotemy

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:

  • Faster Java compilation
  • Reduced memory usage
  • Support for running on Java 20 For more details see https://docs.gradle.org/8.3/release-notes.html To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.3/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation. Daemon will be stopped at the end of the build Path for java installation '/usr/lib/jvm/openjdk-17' (Common Linux Locations) does not contain a java executable

Task :gradle-plugin:pluginDescriptors Task :gradle-plugin:processResources Task :gradle-plugin:compileKotlin Task :gradle-plugin:compileJava NO-SOURCE Task :gradle-plugin:classes Task :gradle-plugin:jar Task :gradle-plugin:inspectClassesForKotlinIC Configure project :expo-av Checking the license for package NDK (Side by side) 25.1.8937393 in /home/expo/Android/Sdk/licenses License for package NDK (Side by side) 25.1.8937393 accepted. Preparing "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393". "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" ready. Installing NDK (Side by side) 25.1.8937393 in /home/expo/Android/Sdk/ndk/25.1.8937393 "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" complete. "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" finished. FAILURE: Build completed with 2 failures. 1: Task failed with an exception.


  • Where: Build file '/home/expo/workingdir/build/node_modules/expo-constants/android/build.gradle' line: 42
  • What went wrong: A problem occurred evaluating project ':expo-constants'.

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

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org. ============================================================================== 2: Task failed with an exception.


  • Where: Script '/home/expo/workingdir/build/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 65
  • What went wrong: A problem occurred configuring project ':expo'.

Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

  • Try:

Run with --stacktrace option to get the stack trace.

Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org. ============================================================================== BUILD FAILED in 2m 23s 5 actionable tasks: 5 executed Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

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 avatar Mar 27 '24 07:03 gtarun8341

Can some one solve

gtarun8341 avatar Mar 27 '24 07:03 gtarun8341

any fix yet?

rahuldasgupta avatar May 05 '24 20:05 rahuldasgupta