Anonymous
React Native — ошибка с обработчиком жестов реагирования
Сообщение
Anonymous » 23 янв 2025, 22:52
Я пытаюсь создать собственное приложение React, но в Android возникает следующая ошибка:
Код: Выделить всё
Execution failed for task ':react-native-gesture-handler:compileDebugKotlin
Мои зависимости:
Код: Выделить всё
"dependencies": {
"@dynatrace/react-native-plugin": "^2.305.1",
"@notifee/react-native": "^7.8.2",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-community/netinfo": "^11.3.1",
"@react-native-cookies/cookies": "^6.2.1",
"@react-native-firebase/analytics": "^20.0.0",
"@react-native-firebase/app": "^20.0.0",
"@react-native-firebase/messaging": "^20.0.0",
"@react-native-firebase/remote-config": "^20.0.0",
"@react-native/gradle-plugin": "^0.76.3",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/material-top-tabs": "^6.6.14",
"@react-navigation/native": "^6.1.18",
"@react-navigation/stack": "^6.4.1",
"@reduxjs/toolkit": "^1.9.5",
"@shopify/restyle": "^1.3.0",
"@types/clone": "^2.1.1",
"@types/react-redux": "^7.1.9",
"axios": "^1.4.0",
"better-docs": "^2.7.2",
"clone": "^2.1.2",
"compare-versions": "^6.1.0",
"husky": "^9.1.3",
"identity-obj-proxy": "^3.0.0",
"lint-staged": "^15.0.2",
"moment": "^2.29.1",
"react": "^18.2.0",
"react-dom": "^18.0.0",
"react-native": "^0.71.18",
"react-native-adjust": "^4.35.1",
"react-native-base64": "^0.2.1",
"react-native-blob-util": "0.19.4",
"react-native-bootsplash": "^4.3.3",
"react-native-contacts": "^7.0.4",
"react-native-crypto-js": "^1.0.0",
"react-native-device-info": "^11.1.0",
"react-native-elements": "^2.3.2",
"react-native-exit-app": "^1.1.0",
"react-native-fast-image": "^8.3.2",
"react-native-fs": "^2.20.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-bottom-sheet": "^1.0.9",
"react-native-gesture-handler": "^2.9.0",
"react-native-gradle-plugin": "^0.71.19",
"react-native-hash": "^3.0.3",
"react-native-image-helper": "0.0.3",
"react-native-inappbrowser-reborn": "^3.7.0",
"react-native-offline": "^6.0.2",
"react-native-popup-menu": "^0.16.1",
"react-native-public-ip": "^1.0.2",
"react-native-reanimated": "3.12.0",
"react-native-redash": "^18.1.3",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "^2.11.0",
"react-native-share": "^11.0.3",
"react-native-size-matters": "^0.4.0",
"react-native-splash-screen": "^3.2.0",
"react-native-store-review": "^0.4.3",
"react-native-svg": "15.3.0",
"react-native-swrve-plugin": "5.0.0",
"react-native-system-setting": "^1.7.6",
"react-native-vector-icons": "^10.1.0",
"react-native-webview": "^13.8.6",
"react-redux": "^8.1.2",
"redux": "^4.0.5",
"redux-saga": "^1.1.3"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@babel/runtime": "^7.24.4",
"@react-native-community/eslint-config": "^3.2.0",
"@redux-saga/types": "^1.1.0",
"@testing-library/react-native": "^12.5.0",
"@tsconfig/react-native": "^3.0.5",
"@types/enzyme": "^3.10.14",
"@types/enzyme-adapter-react-16": "1.0.6",
"@types/jest": "^29.5.5",
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.0",
"@types/react-native": "^0.71.13",
"@types/react-native-base64": "^0.2.2",
"@types/react-test-renderer": "^18.0.2",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"babel-jest": "^29.7.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.6.1",
"eslint": "^8.19.0",
"jest": "^29.7.0",
"jest-environment-enzyme": "^7.1.2",
"jest-enzyme": "^7.1.2",
"jsdoc": "^4.0.2",
"metro-react-native-babel-preset": "^0.73.10",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "^18.2.0",
"reactotron-react-native": "5.0.0",
"reactotron-redux": "3.1.3",
"reactotron-redux-saga": "4.2.3",
"redux-devtools-extension": "^2.13.8",
"typescript": "^5.2.2"
},
Мой android/build.gradle:
Код: Выделить всё
buildscript {
apply from: "../node_modules/@dynatrace/react-native-plugin/files/plugin.gradle", to: buildscript
ext {
minSdkVersion = 23
buildToolsVersion = "33.0.0"
compileSdkVersion = 34
targetSdkVersion = 34
kotlinVersion = "1.6.0"
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
androidXAnnotation = "1.2.0"
androidXBrowser = "1.3.0"
}
repositories {
google()
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
classpath('com.android.tools.build:gradle:8.7.2')
classpath 'com.google.gms:google-services:4.4.1'
classpath("com.facebook.react:react-native-gradle-plugin")
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "../node_modules/@dynatrace/react-native-plugin/files/dynatrace.gradle"
Я попробовал следующее: в моем package.json я удалил «^» в строке ниже:
Благодаря этому изменению мое приложение создано успешно,
НО мое приложение ведет себя странно, в нем есть проблемы с навигацией.
Есть идеи, как решить эту проблему, не удаляя "^"? До прошлой недели мое приложение работало отлично, и однажды я начал экспериментировать с таким поведением.
Подробнее здесь:
https://stackoverflow.com/questions/793 ... re-handler
1737661928
Anonymous
Я пытаюсь создать собственное приложение React, но в Android возникает следующая ошибка: [code]Execution failed for task ':react-native-gesture-handler:compileDebugKotlin[/code] Мои зависимости: [code]"dependencies": { "@dynatrace/react-native-plugin": "^2.305.1", "@notifee/react-native": "^7.8.2", "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-community/netinfo": "^11.3.1", "@react-native-cookies/cookies": "^6.2.1", "@react-native-firebase/analytics": "^20.0.0", "@react-native-firebase/app": "^20.0.0", "@react-native-firebase/messaging": "^20.0.0", "@react-native-firebase/remote-config": "^20.0.0", "@react-native/gradle-plugin": "^0.76.3", "@react-navigation/bottom-tabs": "^6.6.1", "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.18", "@react-navigation/stack": "^6.4.1", "@reduxjs/toolkit": "^1.9.5", "@shopify/restyle": "^1.3.0", "@types/clone": "^2.1.1", "@types/react-redux": "^7.1.9", "axios": "^1.4.0", "better-docs": "^2.7.2", "clone": "^2.1.2", "compare-versions": "^6.1.0", "husky": "^9.1.3", "identity-obj-proxy": "^3.0.0", "lint-staged": "^15.0.2", "moment": "^2.29.1", "react": "^18.2.0", "react-dom": "^18.0.0", "react-native": "^0.71.18", "react-native-adjust": "^4.35.1", "react-native-base64": "^0.2.1", "react-native-blob-util": "0.19.4", "react-native-bootsplash": "^4.3.3", "react-native-contacts": "^7.0.4", "react-native-crypto-js": "^1.0.0", "react-native-device-info": "^11.1.0", "react-native-elements": "^2.3.2", "react-native-exit-app": "^1.1.0", "react-native-fast-image": "^8.3.2", "react-native-fs": "^2.20.0", "react-native-geolocation-service": "^5.3.1", "react-native-gesture-bottom-sheet": "^1.0.9", "react-native-gesture-handler": "^2.9.0", "react-native-gradle-plugin": "^0.71.19", "react-native-hash": "^3.0.3", "react-native-image-helper": "0.0.3", "react-native-inappbrowser-reborn": "^3.7.0", "react-native-offline": "^6.0.2", "react-native-popup-menu": "^0.16.1", "react-native-public-ip": "^1.0.2", "react-native-reanimated": "3.12.0", "react-native-redash": "^18.1.3", "react-native-safe-area-context": "^3.1.8", "react-native-screens": "^2.11.0", "react-native-share": "^11.0.3", "react-native-size-matters": "^0.4.0", "react-native-splash-screen": "^3.2.0", "react-native-store-review": "^0.4.3", "react-native-svg": "15.3.0", "react-native-swrve-plugin": "5.0.0", "react-native-system-setting": "^1.7.6", "react-native-vector-icons": "^10.1.0", "react-native-webview": "^13.8.6", "react-redux": "^8.1.2", "redux": "^4.0.5", "redux-saga": "^1.1.3" }, "devDependencies": { "@babel/cli": "^7.24.1", "@babel/core": "^7.24.4", "@babel/preset-env": "^7.24.4", "@babel/runtime": "^7.24.4", "@react-native-community/eslint-config": "^3.2.0", "@redux-saga/types": "^1.1.0", "@testing-library/react-native": "^12.5.0", "@tsconfig/react-native": "^3.0.5", "@types/enzyme": "^3.10.14", "@types/enzyme-adapter-react-16": "1.0.6", "@types/jest": "^29.5.5", "@types/react": "^18.0.24", "@types/react-dom": "^18.0.0", "@types/react-native": "^0.71.13", "@types/react-native-base64": "^0.2.2", "@types/react-test-renderer": "^18.0.2", "@typescript-eslint/eslint-plugin": "^6.7.3", "@typescript-eslint/parser": "^6.7.3", "babel-jest": "^29.7.0", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.6", "enzyme-to-json": "^3.6.1", "eslint": "^8.19.0", "jest": "^29.7.0", "jest-environment-enzyme": "^7.1.2", "jest-enzyme": "^7.1.2", "jsdoc": "^4.0.2", "metro-react-native-babel-preset": "^0.73.10", "react-native-svg-transformer": "^1.0.0", "react-test-renderer": "^18.2.0", "reactotron-react-native": "5.0.0", "reactotron-redux": "3.1.3", "reactotron-redux-saga": "4.2.3", "redux-devtools-extension": "^2.13.8", "typescript": "^5.2.2" }, [/code] Мой android/build.gradle: [code]buildscript { apply from: "../node_modules/@dynatrace/react-native-plugin/files/plugin.gradle", to: buildscript ext { minSdkVersion = 23 buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34 kotlinVersion = "1.6.0" // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" androidXAnnotation = "1.2.0" androidXBrowser = "1.3.0" } repositories { google() mavenCentral() flatDir { dirs 'libs' } } dependencies { classpath('com.android.tools.build:gradle:8.7.2') classpath 'com.google.gms:google-services:4.4.1' classpath("com.facebook.react:react-native-gradle-plugin") classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } apply from: "../node_modules/@dynatrace/react-native-plugin/files/dynatrace.gradle" [/code] Я попробовал следующее: в моем package.json я удалил «^» в строке ниже: [code]"react-native-gesture-handler": "^2.9.0"[/code] Благодаря этому изменению мое приложение создано успешно, [b]НО[/b] мое приложение ведет себя странно, в нем есть проблемы с навигацией. Есть идеи, как решить эту проблему, не удаляя "^"? До прошлой недели мое приложение работало отлично, и однажды я начал экспериментировать с таким поведением. Подробнее здесь: [url]https://stackoverflow.com/questions/79382399/react-native-error-with-react-native-gesture-handler[/url]