infinitered / infinitered/react-native-mlkit

Inconsistent JVM-target compatibility detected

Open
#209 3 comments 0 reactions 0 assignees View on GitHub
needs reproduction
Dominant language
TypeScript
Stars
444
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Reproduce:

1. `npx ignite-cli@latest new pizza-app` (Select most settings default, no git repo, **enable new architecture**)
2. `cd pizza-app`
3. `yarn android`

This far is fine.

4. `yarn expo install @infinitered/react-native-mlkit-document-scanner`
5. `yarn android`

Here it will fail to build with the following error

```
yarn run v1.22.22
$ expo run:android
› Building app...
Configuration on demand is an incubating feature.

> Configure project :expo

Using expo modules
- infinitered-react-native-mlkit-core (3.1.0)
- infinitered-react-native-mlkit-document-scanner (3.1.0)
- expo-application (6.0.2)
- expo-asset (11.0.4)
- expo-constants (17.0.7)
- expo-file-system (18.0.11)
- expo-font (13.0.4)
- expo-keep-awake (14.0.3)
- expo-linking (7.0.5)
- expo-localization (16.0.1)
- expo-modules-core (2.2.2)
- expo-splash-screen (0.29.22)
- expo-system-ui (4.0.8)

> Configure project :react-native-mmkv
[react-native-mmkv] Thank you for using react-native-mmkv ❤️
[react-native-mmkv] If you enjoy using react-native-mmkv, please consider sponsoring this project: https://github.com/sponsors/mrousavy

> Configure project :react-native-reanimated
Android gradle plugin: 8.6.0
Gradle: 8.10.2

> Task :expo-constants:createExpoConfig
Warning: Root-level "expo" object found. Ignoring extra keys in Expo config: "name", "displayName", "ignite"
Learn more: https://expo.fyi/root-expo-object

> Task :app:processDebugMainManifest
/Users/agoransson/Projects/temp/pizza-app/android/app/src/debug/AndroidManifest.xml:6:5-162 Warning:
application@android:usesCleartextTraffic was tagged at AndroidManifest.xml:6 to replace other declarations but no other declaration present
/Users/agoransson/Projects/temp/pizza-app/android/app/src/debug/AndroidManifest.xml Warning:
provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present

> Task :infinitered-react-native-mlkit-document-scanner:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':infinitered-react-native-mlkit-document-scanner:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (21).

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

* 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 7s
326 actionable tasks: 87 executed, 230 from cache, 9 up-to-date
Error: /Users/agoransson/Projects/temp/pizza-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
Error: /Users/agoransson/Projects/temp/pizza-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
at ChildProcess.completionListener (/Users/agoransson/Projects/temp/pizza-app/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13)
at Object.onceWrapper (node:events:632:26)
at ChildProcess.emit (node:events:517:28)
at maybeClose (node:internal/child_process:1098:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)
...
at spawnAsync (/Users/agoransson/Projects/temp/pizza-app/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21)
at spawnGradleAsync (/Users/agoransson/Projects/temp/pizza-app/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:134:28)
at assembleAsync (/Users/agoransson/Projects/temp/pizza-app/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:83:16)
at runAndroidAsync (/Users/agoransson/Projects/temp/pizza-app/node_modules/@expo/cli/src/run/android/runAndroidAsync.ts:48:24)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

System:
```
agoransson@MacBook-Pro pizza-app % node -v
v18.20.4
```
Also tested with:
```
agoransson@MacBook-Pro pizza-app % node -v
v20.12.2
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the listed Ignite, Expo, and Android commands, then inspect the :infinitered-react-native-mlkit-document-scanner:compileDebugKotlin task and its Java 17/Kotlin 21 target mismatch. Done means the Android build completes successfully after installing the document scanner package.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, react-native, typescript
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.