expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
34.36k stars 5.49k forks source link

Task :expo-dev-menu:compileDebugKotlin FAILED #17217

Closed kuliantnt closed 2 years ago

kuliantnt commented 2 years ago

Summary

I use android studio to compile my expo project, it prompts an error。

Task :expo-dev-menu:compileDebugKotlin FAILED e: /ryland/Documents/WorkSpace/YesPlayMusic-Mobile/node_modules/expo-dev-menu/android/src/debug/java/expo/modules/devmenu/DevMenuManager.kt: (44, 29): Unresolved reference: tests e: /ryland/Documents/WorkSpace/YesPlayMusic-Mobile/node_modules/expo-dev-menu/android/src/debug/java/expo/modules/devmenu/DevMenuManager.kt: (45, 29): Unresolved reference: tests e: /ryland/Documents/WorkSpace/YesPlayMusic-Mobile/node_modules/expo-dev-menu/android/src/debug/java/expo/modules/devmenu/DevMenuManager.kt: (66, 24): Unresolved reference: DevMenuTestInterceptor e: /ryland/Documents/WorkSpace/YesPlayMusic-Mobile/node_modules/expo-dev-menu/android/src/debug/java/expo/modules/devmenu/DevMenuManager.kt: (66, 49): Unresolved reference: DevMenuDisabledTestInterceptor

The error locates at DevMenuManager.kt insideexpo-dev-menumodule, and the IDE says can't resolve reference: tests when importing expo.module.devmenu.tests.*

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

44

Environment

expo-env-info 1.0.3 environment info: System: OS: Linux 5.16 Arch Linux Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node Yarn: 1.22.18 - /usr/bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm Watchman: 20220410.024423.0 - /usr/bin/watchman SDKs: Android SDK: API Levels: 30 Build Tools: 29.0.2, 30.0.2, 32.0.0, 32.1.0 System Images: android-30 | Google APIs Intel x86 Atom npmPackages: expo: >=44.0.0-0 <45.0.0 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 Expo Workflow: bare

lukmccall commented 2 years ago

Hi @kuliantnt, could you provide a version of the expo-dev-menu? Also, it would be nice if you could create a simple demo on GitHub where I could reproduce that bug.

kuliantnt commented 2 years ago

Thank you, I finally found that the problem was that I deleted all the tests files in the project and the project failed to start

mr4th commented 2 years ago

having similar errror

Task :expo-dev-menu:compileDebugKotlin FAILED e: C:\Users\AJAH-FACULTY002\Documents\UberLive\node_modules\expo-dev-menu\android\src\expo-44\java\expo\modules\devmenu\DevMenuPackageDelegate.kt: (4, 37): Unresolved reference: ReactActivityHandler e: C:\Users\AJAH-FACULTY002\Documents\UberLive\node_modules\expo-dev-menu\android\src\expo-44\java\expo\modules\devmenu\DevMenuPackageDelegate.kt: (12, 68): Unresolved reference: ReactActivityHandler e: C:\Users\AJAH-FACULTY002\Documents\UberLive\node_modules\expo-dev-menu\android\src\main\java\expo\modules\devmenu\DevMenuPackage.kt: (15, 37): Unresolved reference: ReactActivityHandler e: C:\Users\AJAH-FACULTY002\Documents\UberLive\node_modules\expo-dev-menu\android\src\main\java\expo\modules\devmenu\DevMenuPackage.kt: (34, 3): 'createReactActivityHandlers' overrides nothing e: C:\Users\AJAH-FACULTY002\Documents\UberLive\node_modules\expo-dev-menu\android\src\main\java\expo\modules\devmenu\DevMenuPackage.kt: (34, 77): Unresolved reference: ReactActivityHandler w: Detected multiple Kotlin daemon sessions at build\kotlin\sessions

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.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 49s

lukmccall commented 2 years ago

@mr4th could you post a simple project with that issue? Otherwise, I won't be able to reproduce that.

mr4th commented 2 years ago

i just sent you an invite as a contributor

On Wed, Jun 29, 2022 at 11:06 AM Łukasz Kosmaty @.***> wrote:

@mr4th https://github.com/mr4th could you post a simple project with that issue? Otherwise, I won't be able to reproduce that.

— Reply to this email directly, view it on GitHub https://github.com/expo/expo/issues/17217#issuecomment-1169790217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFU7Z2RRQYZUQK6CW2FPICDVRQN3BANCNFSM5UMHMEPQ . You are receiving this because you were mentioned.Message ID: @.***>

lukmccall commented 2 years ago

Hmm, I'm not able to build it, but it's failing with a different error 🤔

mr4th commented 2 years ago

please can you send me the new error you are getting incase i have encountered it before, and what did you do to get rid of the previous error?

lukmccall commented 2 years ago

In my case, the project couldn't resolve a native dependency - native-full-sdk. However, I think that you're using the incorrect version of the dev-client package. When you run expo docktor you will see something like this:

Some dependencies are incompatible with the installed expo package version:
 - @stripe/stripe-react-native - expected version: 0.2.2 - actual version installed: 0.4.0
 - expo-dev-client - expected version: ~0.6.3 - actual version installed: 0.9.6
 - react-native-gesture-handler - expected version: ~1.10.2 - actual version installed: 2.3.2
 - react-native-svg - expected version: 12.1.1 - actual version installed: 12.3.0
 - react-native-webview - expected version: 11.13.0 - actual version installed: 11.18.1
mr4th commented 2 years ago

okay thanks alot @lukmccall i will check the dev -client version out

joaofernandesbytepitch commented 2 years ago

@kuliantnt Have you managed to get this fixed?

mr4th commented 2 years ago

yes, thank you. i had to create a complete new boiler plate project and add the component one after the other

On Mon, Nov 7, 2022 at 1:02 PM joaofernandesbytepitch < @.***> wrote:

@kuliantnt https://github.com/kuliantnt Have you managed to get this fixed?

— Reply to this email directly, view it on GitHub https://github.com/expo/expo/issues/17217#issuecomment-1305503588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFU7Z2VHL5IPBVH7PHFVUHDWHDVVDANCNFSM5UMHMEPQ . You are receiving this because you were mentioned.Message ID: @.***>

danb4r commented 1 year ago

I was getting the same error Task :expo-dev-menu:compileDebugKotlin FAILED with the package.json file bellow, no matter the app code. Windows environment (expo-env-info bellow).

I fixed removing yarn.lock and .yarn.clean from project folder, and node_modules as well, and switching from yarn (1.22.19) to npm (9.2.0), and rebuilding:

npm install
npx expo prebuild --clean
npx expo run:android --device

My package.json file:

{
  "name": "myapp",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/metro-config": "^0.5.1",
    "@expo/webpack-config": "^0.17.2",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-firebase/app": "^16.4.6",
    "@react-native-firebase/auth": "^16.4.6",
    "@react-native-firebase/firestore": "^16.4.6",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-navigation/bottom-tabs": "^6.3.3",
    "@react-navigation/native": "^6.0.12",
    "@react-navigation/stack": "^6.3.1",
    "camelize": "^1.0.0",
    "deepmerge": "^4.2.2",
    "expo": "~47.0.12",
    "expo-dev-client": "~2.0.1",
    "expo-localization": "~14.0.0",
    "expo-navigation-bar": "~2.0.1",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-system-ui": "~2.0.1",
    "i18n-js": "^4.1.1",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-paper": "^4.12.5",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-web": "~0.18.7"
  },
  "devDependencies": {
    "@babel/core": "^7.19.3",
    "@types/react": "~18.0.24",
    "@types/react-native": "~0.70.6",
    "babel-plugin-module-resolver": "^4.1.0",
    "babel-preset-expo": "^9.2.2",
    "eslint-plugin-react-hooks": "^4.6.0"
  },
  "private": true,
  "peerDependencies": {
    "@babel/preset-env": "^7.1.6",
    "eslint": "^8.0.0",
    "expo-modules-autolinking": "^0.12.0",
    "react-native-vector-icons": "^9.2.0"
  }
}
npx expo-env-info   

  expo-env-info 1.0.5 environment info:
    System:
      OS: Windows 10 10.0.22621
    Binaries:
      Node: 16.18.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
    SDKs:
      Android SDK:
        API Levels: 30, 31, 32
        Build Tools: 30.0.2, 30.0.3, 31.0.0
        System Images: android-30 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom 
    IDEs:
      Android Studio: AI-213.7172.25.2113.9123335
    npmPackages:
      @expo/metro-config: ^0.5.1 => 0.5.2
      @expo/webpack-config: ^0.17.2 => 0.17.4
      babel-preset-expo: ^9.2.2 => 9.2.2
      expo: ~47.0.12 => 47.0.12
      react: 18.1.0 => 18.1.0
      react-dom: 18.1.0 => 18.1.0
      react-native: 0.70.5 => 0.70.5
      react-native-web: ~0.18.7 => 0.18.10
    Expo Workflow: bare