任务:expo dev菜单:compileDebugKotlin失败



摘要

应为:运行npx expo run:android以编译应用程序。失败并出现错误:任务:expo dev菜单:compileDebugKotlin失败在此处输入图像描述

> Task :expo-dev-menu:compileDebugKotlin FAILED
e: /Users/vladislavcherksheninov/Documents/Hammashelppi/hammashelppi-app/node_modules/expo-dev-menu/vendored/react-native-gesture-handler/android/devmenu/com/swmansion/gesturehandler/PanGestureHandler.kt: (57, 36): Type mismatch: inferred type is Context? but Context was expected

解决方案https://github.com/expo/expo/issues/17217这里没有帮助。互联网上的任何东西也无济于事。

当一切都很好的时候,我试图将expo-dev-client降级到1.0.1,但无济于事。CCD_ 3是唯一使用CCD_。我没有单独安装expo-dev-menu,它自动在node_modules文件夹中

发生这种情况的平台是什么

安卓

环境

expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.6
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.5.0 - /usr/local/bin/npm
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8193401
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
npmPackages:
@expo/metro-config: ^0.4.0 => 0.4.0 
expo: ~46.0.13 => 46.0.13 
react: 18.0.0 => 18.0.0 
react-dom: 18.0.0 => 18.0.0 
react-native: 0.69.6 => 0.69.6 
react-native-web: ~0.18.7 => 0.18.9 
npmGlobalPackages:
eas-cli: 2.3.0
expo-cli: 6.0.6
Expo Workflow: bare

最小可重复示例

包.json

{
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll",
"testDebug": "jest -o --watch --coverage=false",
"testFinal": "jest",
"updateSnapshots": "jest -u --coverage=false",
"debug": "open 'rndebugger://set-debugger-loc?host=localhost&port=19000'"
},
"jest": {
"projects": [
{
"preset": "jest-expo/ios"
},
{
"preset": "jest-expo/android"
}
],
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.{js,jsx,ts,tsx}",
"!**/coverage/**",
"!**/node_modules/**",
"!**/babel.config.js",
"!**/jest.config.ts"
],
"setupFiles": [
"./__mocks__/@react-native-async-storage/async-storage.js"
]
},
"dependencies": {
"@apollo/client": "^3.7.0",
"@expo-google-fonts/raleway": "^0.2.2",
"@expo/config-plugins": "^5.0.0",
"@expo/metro-config": "^0.4.0",
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-community/datetimepicker": "6.2.0",
"@react-native-masked-view/masked-view": "0.2.7",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.0",
"@react-navigation/stack": "^6.3.1",
"@reduxjs/toolkit": "^1.8.5",
"@rneui/base": "^4.0.0-rc.6",
"@rneui/themed": "^4.0.0-rc.6",
"@sentry/react-native": "4.2.2",
"@stripe/stripe-react-native": "^0.19.0",
"dotenv": "^16.0.2",
"expo": "~46.0.13",
"expo-app-loading": "~2.1.0",
"expo-apple-authentication": "~4.3.0",
"expo-application": "~4.2.2",
"expo-background-fetch": "~10.3.0",
"expo-build-properties": "~0.3.0",
"expo-camera": "~12.3.0",
"expo-constants": "~13.2.4",
"expo-dev-client": "^1.3.0",
"expo-device": "~4.3.0",
"expo-image-loader": "~3.2.0",
"expo-image-manipulator": "~10.4.0",
"expo-image-picker": "~13.3.1",
"expo-keep-awake": "~10.2.0",
"expo-linear-gradient": "~11.4.0",
"expo-local-authentication": "~12.3.0",
"expo-media-library": "~14.2.0",
"expo-modules-autolinking": "~0.10.1",
"expo-notifications": "~0.16.1",
"expo-screen-capture": "~4.3.0",
"expo-splash-screen": "~0.16.2",
"expo-status-bar": "~1.4.0",
"expo-system-ui": "~1.3.0",
"expo-task-manager": "~10.3.0",
"expo-updates": "~0.14.6",
"expo-web-browser": "~11.0.0",
"firebase": "^9.10.0",
"graphql": "^16.6.0",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-agora": "^3.7.1",
"react-native-bouncy-checkbox": "^3.0.4",
"react-native-calendars": "^1.1289.0",
"react-native-date-picker": "^4.2.5",
"react-native-dotenv": "^3.3.1",
"react-native-element-dropdown": "^2.3.0",
"react-native-gesture-handler": "~2.5.0",
"react-native-gifted-chat": "^1.0.4",
"react-native-paper": "^4.12.4",
"react-native-progress": "^5.0.0",
"react-native-reanimated": "~2.9.1",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-svg": "12.3.0",
"react-native-toast-message": "^2.1.5",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "~0.18.7",
"react-native-webview": "11.23.0",
"react-redux": "^8.0.4",
"redux": "^4.2.0",
"redux-saga": "^1.2.1",
"redux-thunk": "^2.4.1",
"sentry-expo": "~5.0.0"
},
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/preset-env": "^7.19.3",
"@types/node": "^18.8.2",
"@types/react": "~18.0.0",
"@types/react-dom": "~18.0.0",
"@types/react-native": "~0.69.1",
"@types/react-redux": "^7.1.24",
"babel-jest": "^29.1.2",
"expo-module-scripts": "^2.1.1",
"jest": "^26.6.3",
"jest-expo": "^46.0.1",
"react-test-renderer": "^18.2.0",
"remote-redux-devtools": "^0.5.16",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typescript": "^4.6.3"
},
"resolutions": {
"standard-version-expo/**/@expo/config-plugins": "4.1.0",
"@types/react": "~18.0.0",
"@types/react-dom": "~18.0.0",
"@types/react-native": "~0.69.1"
},
"private": true,
"name": "hammashelppi-app",
"version": "2.0.0"
}

App.tsx-是唯一一个,其中是expo-dev-client。我不使用expo-dev-menu,但开发客户端将其用作依赖

import 'expo-dev-client'
import React from 'react'
import { LogBox } from 'react-native'
import * as Sentry from 'sentry-expo'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { Provider as PaperProvider } from 'react-native-paper'
import { NavigationContainer } from '@react-navigation/native'
import { Provider as ReduxProvider } from 'react-redux'
import { StripeProvider } from '@stripe/stripe-react-native'
import MainNavigator from './src/navigation/MainNavigator/MainNavigator'
import { store } from './src/redux/store'
import ToastConfig from './src/components/UI/Toast/ToastConfig'
import * as RootNavigation from "./src/helpers/root-navigation"
import { registerNotifications } from "./src/helpers/expo-functions"
import { useIncomingNotifications } from "./src/hooks/use-incoming-notifications"
LogBox.ignoreLogs(["AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage"])
Sentry.init({
dsn: process.env.SENTRY_DSN,
enableInExpoDevelopment: true,
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
})
registerNotifications()
const App = () => {
useIncomingNotifications()
return (
<StripeProvider
publishableKey={process.env.STRIPE_PUBLISHIBLE_KEY || ""}
>
<ReduxProvider store={store}>
<PaperProvider>
<SafeAreaProvider>
<NavigationContainer ref={RootNavigation.navigationRef}>
<MainNavigator />
<ToastConfig />
</NavigationContainer>
</SafeAreaProvider>
</PaperProvider>
</ReduxProvider>
</StripeProvider>
)
}
export default App

我也经历过这种情况。

@stripe/stripe-react-native@0.19.0需要android sdk版本33。

expo-dev-client的版本是1.3.0,但昨天刚刚发布1.3.1,其中包括对expo-dev菜单的升级。这次升级到expo-dev菜单(v1.3.1(修复了android sdk 33上的编译错误。

https://github.com/expo/expo/blob/main/packages/expo-dev-menu/CHANGELOG.md#131--2022-10-11

我建议将expo-dev客户端升级到v1.3.1

相关内容

  • 没有找到相关文章

最新更新