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

[SDK52] [expo-updates] android build failure: Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'kspDebugKotlin' (21). #33107

Closed
rranjan14 opened this issue Nov 20, 2024 · 14 comments · Fixed by #33148
Labels
needs more info To be used when awaiting reporter response needs review Issue is ready to be reviewed by a maintainer

Comments

@rranjan14
Copy link

Minimal reproducible example

https://github.com/rranjan14/expo-update-test

What platform(s) does this occur on?

Android

Where did you reproduce the issue?

in a development build

Summary

ksp version is too old for the kotlin version being used. Happening with expo-updates.
Screenshot 2024-11-20 at 16 19 37

JVM version I am using is 17

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: macOS 15.1.1
      Shell: 3.7.1 - /opt/homebrew/bin/fish
    Binaries:
      Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.1/bin/yarn
      npm: 10.9.0 - /opt/homebrew/bin/npm
      Watchman: 2024.11.18.00 - /opt/homebrew/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
      Android SDK:
        API Levels: 33, 34, 35
        Build Tools: 30.0.2, 30.0.3, 33.0.0, 34.0.0, 35.0.0, 35.0.0
        System Images: android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
    IDEs:
      Android Studio: 2024.2 AI-242.23339.11.2421.12550806
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.8 => 52.0.8
      react: 18.3.1 => 18.3.1
      react-native: 0.76.2 => 0.76.2
    npmGlobalPackages:
      eas-cli: 13.1.1
    Expo Workflow: managed

Expo Doctor Diagnostics

Enabled experimental React Native Directory checks. Unset the EXPO_DOCTOR_ENABLE_DIRECTORY_CHECK environment variable to disable this check.
✔ Check package.json for common issues
✔ Check Expo config for common issues
✔ Check native tooling versions
✔ Check if the project meets version requirements for submission to app stores
✔ Check for common project setup issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check for issues with Metro config
✔ Check npm/ yarn versions
✔ Validate packages against React Native Directory package metadata
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK

Didn't find any issues with the project!
@rranjan14 rranjan14 added the needs validation Issue needs to be validated label Nov 20, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Nov 20, 2024
@AbdulRehman960
Copy link

AbdulRehman960 commented Nov 20, 2024

Same issue, any solution?

"expo": "^52.0.0",
"expo-updates": "~0.26.7",
"react-native": "0.76.2",
"react": "18.3.1",

@lukmccall
Copy link
Contributor

I was unable to reproduce the issue, and the repository link is broken. Could you create a minimal reproduction for us to investigate the problem further?

I've created a fresh project with:

@lukmccall lukmccall added the needs more info To be used when awaiting reporter response label Nov 20, 2024
@rranjan14
Copy link
Author

rranjan14 commented Nov 20, 2024

I was unable to reproduce the issue, and the repository link is broken. Could you create a minimal reproduction for us to investigate the problem further?

I've created a fresh project with:

Hey, I made it private mistakingly. I have made it public now. I am using the same versions as mentioned by you. Also, I have removed the actual extra.eas.projectId and updates.url. You'll need to fill in with your values.

I tried an eas build too, but it failed. I have tried 2 kotlin version - 1.8.22 and 1.9.24. Same result on both

@gtwilliams03
Copy link

gtwilliams03 commented Nov 20, 2024

I am getting the same error also (although I suspect mine was related to moving from a 2019 MacBook Pro to a new M4 Max MacBook Pro (and I have had to reinstall several coding related packages to move from x64 to arm64 packages. Android Studio, Android SDKs, Java JRE and JDK have been the problem children.

Output from my latest Android development build:

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':expo-updates:kspDebugKotlin'.
[RUN_GRADLEW] > Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) 
and 'kspDebugKotlin' (21).
[RUN_GRADLEW]   
[RUN_GRADLEW]   Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
[RUN_GRADLEW]   Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation

So this issue makes me feel like I now have my new environment set up correctly and the error is with expo-updates not with my environment.

@lukmccall
Copy link
Contributor

Hmm, that's weird. I was able to build it locally:
image

@lukmccall
Copy link
Contributor

Can you send me your build logs or link to the build on the EAS?

@rranjan14
Copy link
Author

rranjan14 commented Nov 20, 2024

@lukmccall I am also able to build with the above command you run. However, I am not able to build with eas. Because of this, I am not able to create production builds.

Adding the logs here:

[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] Enabled experimental React Native Directory checks. Unset the EXPO_DOCTOR_ENABLE_DIRECTORY_CHECK environment variable to disable this check.
[RUN_EXPO_DOCTOR] Running 15 checks on your project...
[RUN_EXPO_DOCTOR] ✔ Check package.json for common issues
[RUN_EXPO_DOCTOR] ✖ Check Expo config for common issues
[RUN_EXPO_DOCTOR] ✔ Check native tooling versions
[RUN_EXPO_DOCTOR] ✔ Check if the project meets version requirements for submission to app stores
[RUN_EXPO_DOCTOR] ✔ Check for common project setup issues
[RUN_EXPO_DOCTOR] ✔ Check dependencies for packages that should not be installed directly
[RUN_EXPO_DOCTOR] ✔ Check for app config fields that may not be synced in a non-CNG project
[RUN_EXPO_DOCTOR] ✔ Check for issues with Metro config
[RUN_EXPO_DOCTOR] ✔ Check npm/ yarn versions
[RUN_EXPO_DOCTOR] ✔ Check Expo config (app.json/ app.config.js) schema
[RUN_EXPO_DOCTOR] ✖ Validate packages against React Native Directory package metadata
[RUN_EXPO_DOCTOR] ✔ Check for legacy global CLI installed locally
[RUN_EXPO_DOCTOR] ✔ Check that native modules do not use incompatible support packages
[RUN_EXPO_DOCTOR] ✔ Check that native modules use compatible support package versions for installed Expo SDK
[RUN_EXPO_DOCTOR] ✖ Check that packages match versions required by installed Expo SDK
[RUN_EXPO_DOCTOR] Detailed check results:
[RUN_EXPO_DOCTOR] You have an app.json file in your project, but your app.config.ts is not using the values from it. Remove the static app.json, or use its values in your dynamic app.config.js. Learn more: https://docs.expo.dev/workflow/configuration
[RUN_EXPO_DOCTOR] The following issues were found when validating your dependencies against React Native Directory:
[RUN_EXPO_DOCTOR] Unsupported on New Architecture: react-native-image-crop-picker
[RUN_EXPO_DOCTOR] Untested on New Architecture: expo-notifee-plugin, lucide-react-native
[RUN_EXPO_DOCTOR] Unmaintained: @gorhom/portal, react-native-section-list-get-item-layout
[RUN_EXPO_DOCTOR] No metadata available: @config-plugins/react-native-blob-util, @config-plugins/react-native-pdf, @dev-plugins/react-native-mmkv, @dev-plugins/react-navigation, @webview-bridge/react-native, @xstate/react, eventemitter3, flexsearch, jotai, lodash.throttle, mime, pretty-bytes, react-native-gradient-shimmer, react-native-ios-utilities
[RUN_EXPO_DOCTOR] The following packages should be updated for best compatibility with the installed expo version:
[RUN_EXPO_DOCTOR]   @sentry/[email protected] - expected version: ~6.1.0
[RUN_EXPO_DOCTOR]   @shopify/[email protected] - expected version: 1.7.1
[RUN_EXPO_DOCTOR]   [email protected] - expected version: 18.3.1
[RUN_EXPO_DOCTOR]   [email protected] - expected version: ~2.20.2
[RUN_EXPO_DOCTOR]   [email protected] - expected version: 1.18.0
[RUN_EXPO_DOCTOR]   [email protected] - expected version: 4.12.0
[RUN_EXPO_DOCTOR]   [email protected] - expected version: ~4.1.0
[RUN_EXPO_DOCTOR]   [email protected] - expected version: 15.8.0
[RUN_EXPO_DOCTOR]   @babel/[email protected] - expected version: ^7.25.2
[RUN_EXPO_DOCTOR]   @types/[email protected] - expected version: ~18.3.12
[RUN_EXPO_DOCTOR] Your project may not work correctly until you install the expected versions of the packages.
[RUN_EXPO_DOCTOR] Found outdated dependencies
[RUN_EXPO_DOCTOR] Advice:
[RUN_EXPO_DOCTOR] - Use libraries that are actively maintained and support the New Architecture. Find alternative libraries with https://reactnative.directory.
[RUN_EXPO_DOCTOR] - Add packages to expo.doctor.reactNativeDirectoryCheck.exclude in package.json to selectively skip validations, if the warning is not relevant.
[RUN_EXPO_DOCTOR] - Update React Native Directory to include metadata for unknown packages. Alternatively, set expo.doctor.reactNativeDirectoryCheck.listUnknownPackages in package.json to false to skip warnings about packages with no metadata, if the warning is not relevant.
[RUN_EXPO_DOCTOR]
[RUN_EXPO_DOCTOR] Advice: Use 'npx expo install --check' to review and upgrade your dependencies.
[RUN_EXPO_DOCTOR] One or more checks failed, indicating possible issues with the project.
[RUN_EXPO_DOCTOR] Command "expo doctor" failed.
Error: npx -y expo-doctor exited with non-zero code: 1
    at ChildProcess.completionListener (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at spawnAsync (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawn (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/turtle-spawn/dist/index.js:16:47)
    at runExpoDoctor (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/common/setup.js:112:52)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/common/setup.js:87:36
    at async BuildContext.runBuildPhase (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/context.js:107:28)
    at async setupAsync (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/common/setup.js:85:9)
    at async buildAsync (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/builders/android.js:41:5)
    at async runBuilderWithHooksAsync (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/builders/common.js:12:13)
    at async Object.androidBuilder (/Users/rahulranjan/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/build-tools/dist/builders/android.js:26:16)
[PREBUILD] env: load .env.development.local
[PREBUILD] env: export EXPO_PUBLIC_API_BASE_URL EXPO_PUBLIC_WS_BASE_URL EXPO_PUBLIC_WEBAPP_BASE_URL EXPO_PUBLIC_ENV EXPO_PUBLIC_LOG_DEBUG EXPO_PUBLIC_SENTRY_DSN ANDROID_MAPS_API_KEY IOS_MAPS_API_KEY SENTRY_AUTH_TOKEN
[PREBUILD] - Creating native directory (./android)
[PREBUILD] ✔ Created native directory
[PREBUILD] - Updating package.json
[PREBUILD] ✔ Updated package.json | no changes
[PREBUILD] - Running prebuild
[PREBUILD] ✔ Finished prebuild
[PREBUILD] We detected that 'apps/mobile' is a yarn workspace
[PREBUILD] Running "yarn install --no-immutable --inline-builds" in /var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build directory
[PREBUILD] ➤ YN0000: · Yarn 4.5.0
[PREBUILD] ➤ YN0000: ┌ Project validation
[PREBUILD] ➤ YN0057: │ @wokay/components: Resolutions field will be ignored
[PREBUILD] ➤ YN0000: └ Completed
[PREBUILD] ➤ YN0000: ┌ Resolution step
[PREBUILD] ➤ YN0000: └ Completed in 0s 286ms
[PREBUILD] ➤ YN0000: ┌ Post-resolution validation
[PREBUILD] ➤ YN0060: │ @tiptap/pm is listed by your project with version 2.2.4 (p50d4c), which doesn't satisfy what @tiptap/extension-link and other dependencies request (^2.7.0).
[PREBUILD] ➤ YN0060: │ expo is listed by your project with version 52.0.8 (p79e80), which doesn't satisfy what @config-plugins/detox and other dependencies request (but they have non-overlapping ranges!).
[PREBUILD] ➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
[PREBUILD] ➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
[PREBUILD] ➤ YN0000: └ Completed
[PREBUILD] ➤ YN0000: ┌ Fetch step
[PREBUILD] ➤ YN0000: └ Completed in 0s 859ms
[PREBUILD] ➤ YN0000: ┌ Link step
[PREBUILD] ➤ YN0000: └ Completed in 0s 871ms
[PREBUILD] ➤ YN0000: · Done with warnings in 2s 276ms
[CALCULATE_EXPO_UPDATES_RUNTIME_VERSION] Resolved runtime version: 1.5.65
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[CONFIGURE_EXPO_UPDATES] Setting the update request headers in 'AndroidManifest.xml' to '{"expo-channel-name":"development"}'
[EAGER_BUNDLE] env: load .env.development.local
[EAGER_BUNDLE] env: export EXPO_PUBLIC_API_BASE_URL EXPO_PUBLIC_WS_BASE_URL EXPO_PUBLIC_WEBAPP_BASE_URL EXPO_PUBLIC_ENV EXPO_PUBLIC_LOG_DEBUG EXPO_PUBLIC_SENTRY_DSN ANDROID_MAPS_API_KEY IOS_MAPS_API_KEY SENTRY_AUTH_TOKEN
[EAGER_BUNDLE] Starting Metro Bundler
[EAGER_BUNDLE] Android Bundled 23702ms apps/mobile/index.js (4554 modules)
[EAGER_BUNDLE] Writing bundle output to: /var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/c08duo9xz3w/index.js
[EAGER_BUNDLE] Copying 28 asset files
[EAGER_BUNDLE] Done writing bundle output
[EAGER_BUNDLE]
[RUN_GRADLEW] Running 'gradlew :app:assembleDebug' in /var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/android
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:checkKotlinGradlePluginConfigurationErrors
[RUN_GRADLEW] > Task :gradle-plugin:shared:checkKotlinGradlePluginConfigurationErrors
[RUN_GRADLEW] > Task :gradle-plugin:shared:processResources NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:shared:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:shared:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:shared:classes UP-TO-DATE
[RUN_GRADLEW] > Task :gradle-plugin:shared:jar
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:settings-plugin:jar
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:react-native-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:jar
[RUN_GRADLEW] > Configure project :app
[RUN_GRADLEW] ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' ([email protected])
[RUN_GRADLEW]  ℹ️  Applying gradle plugin 'expo-updates-gradle-plugin' ([email protected])
[RUN_GRADLEW] > Configure project :expo-updates
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] ksp-1.8.22-1.0.11 is too old for kotlin-1.9.24. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.22.
[RUN_GRADLEW] w: `KotlinCompilation.source(KotlinSourceSet)` method is deprecated
[RUN_GRADLEW] and will be removed in upcoming Kotlin releases.
[RUN_GRADLEW] See https://kotl.in/compilation-source-deprecation for details.
[RUN_GRADLEW] w: `KotlinCompilation.source(KotlinSourceSet)` method is deprecated
[RUN_GRADLEW] and will be removed in upcoming Kotlin releases.
[RUN_GRADLEW] See https://kotl.in/compilation-source-deprecation for details.
[RUN_GRADLEW] w: `KotlinCompilation.source(KotlinSourceSet)` method is deprecated
[RUN_GRADLEW] and will be removed in upcoming Kotlin releases.
[RUN_GRADLEW] See https://kotl.in/compilation-source-deprecation for details.
[RUN_GRADLEW] w: `KotlinCompilation.source(KotlinSourceSet)` method is deprecated
[RUN_GRADLEW] and will be removed in upcoming Kotlin releases.
[RUN_GRADLEW] See https://kotl.in/compilation-source-deprecation for details.
[RUN_GRADLEW] w: `KotlinCompilation.source(KotlinSourceSet)` method is deprecated
[RUN_GRADLEW] and will be removed in upcoming Kotlin releases.
[RUN_GRADLEW] See https://kotl.in/compilation-source-deprecation for details.
[RUN_GRADLEW] > Configure project :expo
[RUN_GRADLEW] Using expo modules
[RUN_GRADLEW]   - expo-application (6.0.1)
[RUN_GRADLEW]   - expo-asset (11.0.1)
[RUN_GRADLEW]   - expo-clipboard (7.0.0)
[RUN_GRADLEW]   - expo-constants (17.0.3)
[RUN_GRADLEW]   - expo-crypto (14.0.1)
[RUN_GRADLEW]   - expo-dev-client (5.0.3)
[RUN_GRADLEW]   - expo-dev-launcher (5.0.15)
[RUN_GRADLEW]   - expo-dev-menu (6.0.10)
[RUN_GRADLEW]   - expo-device (7.0.1)
[RUN_GRADLEW]   - expo-document-picker (13.0.1)
[RUN_GRADLEW]   - expo-eas-client (0.13.1)
[RUN_GRADLEW]   - expo-file-system (18.0.4)
[RUN_GRADLEW]   - expo-font (13.0.1)
[RUN_GRADLEW]   - expo-image (2.0.1)
[RUN_GRADLEW]   - expo-image-loader (5.0.0)
[RUN_GRADLEW]   - expo-image-manipulator (13.0.5)
[RUN_GRADLEW]   - expo-image-picker (16.0.2)
[RUN_GRADLEW]   - expo-intent-launcher (12.0.1)
[RUN_GRADLEW]   - expo-json-utils (0.14.0)
[RUN_GRADLEW]   - expo-keep-awake (14.0.1)
[RUN_GRADLEW]   - expo-linear-gradient (14.0.1)
[RUN_GRADLEW]   - expo-linking (7.0.3)
[RUN_GRADLEW]   - expo-location (18.0.2)
[RUN_GRADLEW]   - expo-mail-composer (14.0.1)
[RUN_GRADLEW] - expo-manifests (0.15.3)
[RUN_GRADLEW]   - expo-media-library (17.0.2)
[RUN_GRADLEW]   - expo-modules-core (2.0.4)
[RUN_GRADLEW]   - expo-sharing (13.0.0)
[RUN_GRADLEW]   - expo-splash-screen (0.29.11)
[RUN_GRADLEW]   - expo-structured-headers (4.0.0)
[RUN_GRADLEW]   - expo-system-ui (4.0.3)
[RUN_GRADLEW]   - expo-updates (0.26.7)
[RUN_GRADLEW]   - expo-video-thumbnails (9.0.2)
[RUN_GRADLEW]   - share-with-wokay (UNVERSIONED)
[RUN_GRADLEW] > Configure project :notifee_react-native
[RUN_GRADLEW] :notifee_react-native @notifee/react-native found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@notifee/react-native
[RUN_GRADLEW] :notifee_react-native package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@notifee/react-native/package.json
[RUN_GRADLEW] :notifee_react-native:version set from package.json: 9.1.2 (9,1,2 - 9001002)
[RUN_GRADLEW] :notifee_react-native:android.compileSdk using custom value: 35
[RUN_GRADLEW] :notifee_react-native:android.targetSdk using custom value: 34
[RUN_GRADLEW] :notifee_react-native:android.minSdk using custom value: 24
[RUN_GRADLEW] :notifee_react-native:reactNativeAndroidDir /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/react-native/android
[RUN_GRADLEW] > Configure project :react-native-firebase_app
[RUN_GRADLEW] :react-native-firebase_app package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/app/package.json
[RUN_GRADLEW] :react-native-firebase_app:firebase.bom using default value: 33.5.1
[RUN_GRADLEW] :react-native-firebase_app:play.play-services-auth using default value: 21.2.0
[RUN_GRADLEW] :react-native-firebase_app package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/app/package.json
[RUN_GRADLEW] :react-native-firebase_app:version set from package.json: 21.5.0 (21,5,0 - 21005000)
[RUN_GRADLEW] :react-native-firebase_app:android.compileSdk using custom value: 35
[RUN_GRADLEW] :react-native-firebase_app:android.targetSdk using custom value: 34
[RUN_GRADLEW] :react-native-firebase_app:android.minSdk using custom value: 24
[RUN_GRADLEW] :react-native-firebase_app:reactNativeAndroidDir /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/react-native/android
[RUN_GRADLEW] > Configure project :react-native-firebase_auth
[RUN_GRADLEW] :react-native-firebase_auth package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/auth/package.json
[RUN_GRADLEW] :react-native-firebase_app package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/app/package.json
[RUN_GRADLEW] :react-native-firebase_auth:firebase.bom using default value: 33.5.1
[RUN_GRADLEW] :react-native-firebase_auth package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/auth/package.json
[RUN_GRADLEW] :react-native-firebase_auth:version set from package.json: 21.5.0 (21,5,0 - 21005000)
[RUN_GRADLEW] :react-native-firebase_auth:android.compileSdk using custom value: 35
[RUN_GRADLEW] :react-native-firebase_auth:android.targetSdk using custom value: 34
[RUN_GRADLEW] :react-native-firebase_auth:android.minSdk using custom value: 24
[RUN_GRADLEW] :react-native-firebase_auth:reactNativeAndroidDir /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/react-native/android
[RUN_GRADLEW] > Configure project :react-native-firebase_crashlytics
[RUN_GRADLEW] :react-native-firebase_crashlytics package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/crashlytics/package.json
[RUN_GRADLEW] :react-native-firebase_app package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/app/package.json
[RUN_GRADLEW] :react-native-firebase_crashlytics:firebase.bom using default value: 33.5.1
[RUN_GRADLEW] :react-native-firebase_crashlytics package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/crashlytics/package.json
[RUN_GRADLEW] :react-native-firebase_crashlytics:version set from package.json: 21.5.0 (21,5,0 - 21005000)
[RUN_GRADLEW] :react-native-firebase_crashlytics:android.compileSdk using custom value: 35
[RUN_GRADLEW] :react-native-firebase_crashlytics:android.targetSdk using custom value: 34
[RUN_GRADLEW] :react-native-firebase_crashlytics:android.minSdk using custom value: 24
[RUN_GRADLEW] :react-native-firebase_crashlytics:reactNativeAndroidDir /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/react-native/android
[RUN_GRADLEW] > Configure project :react-native-firebase_messaging
[RUN_GRADLEW] :react-native-firebase_messaging package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/messaging/package.json
[RUN_GRADLEW] :react-native-firebase_app package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/app/package.json
[RUN_GRADLEW] :react-native-firebase_messaging:firebase.bom using default value: 33.5.1
[RUN_GRADLEW] :react-native-firebase_messaging package.json found at /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/@react-native-firebase/messaging/package.json
[RUN_GRADLEW] :react-native-firebase_messaging:version set from package.json: 21.5.0 (21,5,0 - 21005000)
[RUN_GRADLEW] :react-native-firebase_messaging:android.compileSdk using custom value: 35
[RUN_GRADLEW] :react-native-firebase_messaging:android.targetSdk using custom value: 34
[RUN_GRADLEW] :react-native-firebase_messaging:android.minSdk using custom value: 24
[RUN_GRADLEW] :react-native-firebase_messaging:reactNativeAndroidDir /private/var/folders/by/sf7ys4_942792fgdf85gz1000000gn/T/eas-build-local-nodejs/06c47712-a993-4070-970a-fb4f7d54be0d/build/apps/mobile/node_modules/react-native/android
[RUN_GRADLEW] > Configure project :react-native-mmkv
[RUN_GRADLEW] [react-native-mmkv] Thank you for using react-native-mmkv ❤️
[RUN_GRADLEW] [react-native-mmkv] If you enjoy using react-native-mmkv, please consider sponsoring this project: https://github.com/sponsors/mrousavy
[RUN_GRADLEW] > Configure project :react-native-reanimated
[RUN_GRADLEW] Android gradle plugin: 8.6.0
[RUN_GRADLEW] Gradle: 8.10.2
[RUN_GRADLEW] > Configure project :react-native-video
[RUN_GRADLEW] Kotlin version is correct: 1.8.22
[RUN_GRADLEW] useExoplayerIMA: false
[RUN_GRADLEW] useExoplayerSmoothStreaming: false
[RUN_GRADLEW] useExoplayerDash: false
[RUN_GRADLEW] useExoplayerHls: false
[RUN_GRADLEW] useExoplayerRtsp: false
[RUN_GRADLEW] buildFromSource: false
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Could not determine the dependencies of task ':expo-updates:bundleLibCompileToJarDebug'.
[RUN_GRADLEW] > Could not create task ':expo-updates:kspDebugKotlin'.
[RUN_GRADLEW]    > Cannot query the value of task ':expo-updates:compileDebugKotlin' property 'moduleName' because it has no value available.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] > Get more help at https://help.gradle.org.
[RUN_GRADLEW] BUILD FAILED in 20s
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
[RUN_GRADLEW] 23 actionable tasks: 23 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

@rranjan14
Copy link
Author

Is it possible that kspVersion is taken 1.8.x due to the project kotlin version being 1.8.x but the expo-updates-gradle-plugin specifically uses 1.9.24?

Screenshot 2024-11-20 at 21 26 37

@adi87
Copy link

adi87 commented Nov 21, 2024

For what it's worth, I'm getting the exact same error message after upgrading to SDK 52 in my own project and trying to run locally.

npx expo run:android

I was also able to replicate the same issue with the same repro example provided above in the repository expo-update-test.

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: macOS 15.1.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
      npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    Managers:
      CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    IDEs:
      Android Studio: 2024.2 AI-242.23339.11.2421.12550806
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.8 => 52.0.8
      react: 18.3.1 => 18.3.1
      react-native: 0.76.2 => 0.76.2
    Expo Workflow: bare

Edit: Reverting to SDK 51 resolves the issue and the app builds and runs fine on the emulator

@lukmccall
Copy link
Contributor

Which version of java are you using (what is the output of java --version)?
You can also try to add the following lines under the android block:

kotlin {
  jvmToolchain(17)
}

to the android/build.gradle inside of the expo-updates package.

@Kudo
Copy link
Contributor

Kudo commented Nov 21, 2024

when building with android studio. please makes sure to use jdk 17. the new android studio uses its jdk 21 by default.
Screenshot 2024-11-12 at 1 10 02 AM

@vegidio
Copy link

vegidio commented Nov 21, 2024

Same problem for me: I have Java 21 installed in my machine and my project used to build fine with Expo 51, but as soon as I upgraded to Expo 52 I started to get the error below:

> Task :expo-updates:kspDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-updates:kspDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'kspDebugKotlin' (21).

  Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
  Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation

The problem seems to be coming from expo-updates.

@Kudo
Copy link
Contributor

Kudo commented Nov 21, 2024

Same problem for me: I have Java 21 installed in my machine and my project used to build fine with Expo 51, but as soon as I upgraded to Expo 52 I started to get the error below

expo-updates in sdk 51 still uses kapt than ksp.
having #33148 to fix the issue anyway

@esipavicius
Copy link

esipavicius commented Nov 21, 2024

Im also getting this

* What went wrong:
Could not determine the dependencies of task ':expo-updates:bundleLibCompileToJarDebug'.
> Could not create task ':expo-updates:kspDebugKotlin'.
   > Cannot query the value of task ':expo-updates:compileDebugKotlin' property 'moduleName' because it has no value available.

@brentvatne I fixed it with kotlinVersion. I do not know if its good or not.
Screenshot 2024-11-22 at 16 32 32

brentvatne pushed a commit that referenced this issue Nov 21, 2024
…33148)

# Why

fix incompatible jvm target error from expo-updates when using jdk 21
```
Execution failed for task ':expo-updates:kspDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'kspDebugKotlin' (21).
```

fixes #33107

# How

RNGP is not able to enforce jvm toolchain version in KSP. this pr tries
to add jvm toolchain inside the ksp configuration. also introducing a
`applyKspJvmToolchain()` from core, so that we can control the jdk
version from core to reduce maintenance cost.

# Test Plan

- ci passed
- `JAVA_HOME="/Applications/Android
Studio.app/Contents/jbr/Contents/Home" ./gradlew :app:assembleDebug` in
bare-expo. the new jdk inside android studio is jdk 21

# Checklist

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

```
Co-authored-by: Vojtech Novak <[email protected]>
Co-authored-by: lukmccall <[email protected]>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info To be used when awaiting reporter response needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants