Home > Software design >  Task :expo-dev-menu:compileDebugKotlin FAILED
Task :expo-dev-menu:compileDebugKotlin FAILED

Time:10-13

Summary

Expected: running npx expo run:android to compile the app. Fails with error: Task :expo-dev-menu:compileDebugKotlin FAILED enter image description here

> 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

Solution https://github.com/expo/expo/issues/17217 here does not help. Anything on the internet also does not help.

I tried to downgrade expo-dev-client upto 1.0.1 when everything still was fine, but it does not help. expo-dev-client is the only one useing expo-dev-menu. I do not install expo-dev-menu separately, it is in node_modules folder automatically

What platform(s) does this occur on?

Android

Environment

 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

Minimal reproducible example

Package.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 - is the only one, where is expo-dev-client. I do not use expo-dev-menu, but dev-client uses it as a dependency

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

CodePudding user response:

I am also experiencing this.

@stripe/[email protected] requires android sdk version 33.

expo-dev-client is on version 1.3.0, but just released 1.3.1 yesterday, which included an upgrade to expo-dev-menu. This upgrade to expo-dev-menu (v1.3.1) has a fix for compile errors on android sdk 33.

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

I recommend upgrading expo-dev-client to v1.3.1

  • Related