infinitered / react-native-mlkit

The definitive MLKit wrapper for React Native and Expo
https://docs.infinite.red/react-native-mlkit/
187 stars 13 forks source link

Support for Android on Windows development #137

Closed elwoodhouse closed 6 months ago

elwoodhouse commented 7 months ago

Hi,

I'm wondering if running this package in an Android Emulator on a Windows environment is supported?

After I install the @infinitered/react-native-mlkit-core package (and without importing anything into my app), my Android build fails with:

› Building app...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Configuration on demand is an incubating feature.

> Configure project :app
 ??  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@3.6.9)

> Configure project :expo

Using expo modules
  - infinitered-react-native-mlkit-core (0.7.7)
  - expo-constants (15.4.5)
  - expo-dev-client (3.3.11)
  - expo-dev-launcher (3.6.9)
  - expo-dev-menu (4.5.8)
  - expo-file-system (16.0.8)
  - expo-font (11.10.3)
  - expo-json-utils (0.12.3)
  - expo-keep-awake (12.8.2)
  - expo-manifests (0.13.2)
  - expo-modules-core (1.11.12)
  - expo-modules-core$android-annotation-processor (1.11.12)
  - expo-modules-core$android-annotation (1.11.12)
  - expo-splash-screen (0.26.4)
  - expo-system-ui (2.9.3)
  - expo-web-browser (12.8.2)

> Configure project :react-native-reanimated
Android gradle plugin: 8.1.1
Gradle: 8.3

> Task :infinitered-react-native-mlkit-core:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':infinitered-react-native-mlkit-core:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

* 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 52s
306 actionable tasks: 3 executed, 303 up-to-date
Error: D:\...\android\gradlew.bat exited with non-zero code: 1
Error: D:\...\android\gradlew.bat exited with non-zero code: 1
    at ChildProcess.completionListener (D:\...\node_modules\@expo\spawn-async\build\spawnAsync.js:52:23)
    at Object.onceWrapper (node:events:633:26)
    at ChildProcess.emit (node:events:518:28)
    at cp.emit (D:\...\node_modules\@expo\spawn-async\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at Object.spawnAsync [as default] (D:\...\node_modules\@expo\spawn-async\build\spawnAsync.js:17:21)
    at spawnGradleAsync (D:\...\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:72:46)
    at Object.assembleAsync (D:\...\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:52:18)
    at runAndroidAsync (D:\...\node_modules\@expo\cli\build\src\run\android\runAndroidAsync.js:36:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Have I misconfigured something? I started with a create-expo-stack command so I think my project should be setup to handle expo modules ok.

trevor-coleman commented 7 months ago

hey there -- thanks for reporting this. It looks like something broke with the latest expo update.

I'll dig into it and see if I can figure out what's going on. Will probably just need to update the dependencies in the modules.

trevor-coleman commented 7 months ago

Just wanted to update you on this -- I'm working through upgrading the modules and example app to Expo 50, I've just been off sick a couple days which has slowed things down a bit.

trevor-coleman commented 6 months ago

FYI this should be fixed in the latest version (1.0.0) which should be live in a few minutes once the CI finishes its work.

https://github.com/infinitered/react-native-mlkit/pull/142