alpha0010 / react-native-file-access

Filesystem access for React Native
MIT License
298 stars 18 forks source link

react-native-file-access:compileDebugKotlin #38

Closed ethan1141 closed 2 years ago

ethan1141 commented 2 years ago

I get this error. when trying to run react-native run-android and the same with yarn android

BUILD FAILED in 1m 21s

Tried googling the error and tried the solutions and it seems to be related to the module

alpha0010 commented 2 years ago
ethan1141 commented 2 years ago

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

Configure project :expo-structured-headers Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

Configure project :expo Using expo modules — expo-application (4.0.0) — expo-constants (12.1.3) — expo-error-recovery (3.0.3) — expo-file-system (13.0.3) — expo-font (10.0.3) — expo-json-utils (0.2.0) — expo-keep-awake (10.0.0) — expo-manifests (0.2.2) — expo-modules-core (0.4.9) — expo-splash-screen (0.13.5) — expo-structured-headers (2.0.0) — expo-updates (0.10.15) Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal. Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects. If the parent project does not need the plugin, add 'apply false' to the plugin line. See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl The Kotlin plugin was loaded in the following projects: ':expo-updates-interface', ':react-native-ios-context-menu'

Task :react-native-file-access:compileDebugKotlin FAILED e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (9, 28): Unresolved reference: Companion e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (52, 33): Cannot access 'body': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (56, 36): Cannot access 'headers': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (65, 40): Cannot access 'code': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (66, 44): Cannot access 'message': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (67, 37): Cannot access 'request': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (67, 45): Cannot access 'url': it is package-private in 'Request' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (92, 36): Unresolved reference: toRequestBody e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/NetworkHandler.kt: (114, 26): Cannot access 'body': it is package-private in 'Response' e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/ProgressResponseBody.kt: (7, 13): Unresolved reference: buffer e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/ProgressResponseBody.kt: (41, 7): Unresolved reference: buffer e: /Users/{currentUser}/Projects/ROI/node_modules/react-native-file-access/android/src/main/java/com/alpha0010/fs/ProgressResponseBody.kt: (41, 40): Unresolved reference: it

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 27s 474 actionable tasks: 4 executed, 470 up-to-date /Users/{currentUser}/Projects/ROI/android/gradlew exited with non-zero code: 1 Error: /Users/{currentUser}/Projects/ROI/android/gradlew exited with non-zero code: 1 at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13) at Object.onceWrapper (node:events:510:26) at ChildProcess.emit (node:events:390:28) at maybeClose (node:internal/child_process:1064:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) ... at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19) at spawnGradleAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:83:18) at assembleAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:57:16) at actionAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/runAndroid.ts:143:9) at processTicksAndRejections (node:internal/process/task_queues:96:5) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

from package.json { "react-native-file-access": "^2.1.0", "react-native": "0.64.3", }

i can run the example project Thanks

alpha0010 commented 2 years ago

For react native 0.64 (and older), you will need to use the 1.x branch of this library (compatibility). So either upgrade your RN version, or downgrade this library.

ethan1141 commented 2 years ago

For react native 0.64 (and older), you will need to use the 1.x branch of this library (compatibility). So either upgrade your RN version, or downgrade this library.

thankyou that fixed it