Build failed on Bare Workflow SDK 42

Please provide the following:

  1. SDK Version: 42
  2. Platforms(Android/iOS/web/all): Android

My build gets failed for a new SDK 42 project.

Steps,

  • run expo init my-app
  • Choose minimal in Bare Workflow
  • After the installation, run npm run android

while building, it gave me this error,

Task :unimodules-react-native-adapter:compileDebugJavaWithJavac FAILED
require(expo-modules-autolinking)(process.argv.slice(1))
        ^

ReferenceError: expo is not defined
    at [eval]:1:9
    at Script.runInThisContext (vm.js:134:12)
    at Object.runInThisContext (vm.js:311:38)
    at internal/process/execution.js:77:19
    at [eval]-wrapper:6:22
    at evalScript (internal/process/execution.js:76:60)
    at internal/main/eval_string.js:23:3

What went wrong,

* What went wrong:
Execution failed for task ':unimodules-react-native-adapter:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Hey @kartikeyvaish, can you ensure your android local environment is set up properly (see Setting up the development environment · React Native)? Also, can you let me know what versions you are using in said env?

Cheers,
Adam

Hey, @adamjnav. everything was working fine till Expo SDK 41. So I am pretty sure that the development setup has been done perfectly. My other projects based on Expo SDK 41 are working as expected.

My package.json

{
  "main": "index.js",
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "start": "react-native start"
  },
  "dependencies": {
    "expo": "~42.0.0",
    "expo-permissions": "^12.1.1",
    "expo-splash-screen": "~0.11.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.8.0",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "~0.63.4",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-reanimated": "~2.2.0",
    "react-native-screens": "~3.4.0",
    "react-native-unimodules": "~0.14.3",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0"
  },
  "private": true
}

Expo Version
expo --version
4.7.2

Node Version
node -v
v14.17.2

NPM Version
npm-v
6.14.13

Having the exact same problem.

My environment:

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 682.79 MB / 7.79 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.6953283
    Visual Studio: Not Found
  Languages:
    Java: 11.0.2
    Python: 3.8.4
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: ~0.63.4 => 0.63.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Further details about the problem:

this was a bug when running on windows. uninstall react-native-unimodules and reinstall it to get the latest version of @unimodules/react-native-adapter from Publish @unimodules/react-native-adapter · expo/expo@7e86dd7 · GitHub

Hi @notbrent,
I have the same problem when I try to build the Android app with AppCenter.
No issue when I downgrade Expo to SDK 41.

The version of @unimodules/react-native-adapter in expo dependencies is ~6.3.4.
I tried to uninstall and reinstall react-native-unimodules but it doesn’t work more.

Thanks for your help.

Expo 41 with react-native-unimodules 0.14.6 Failed
Expo 42 with react-native-unimodules 0.14.6 Failed
Expo 42 with react-native-unimodules 0.13.3 Failed
Expo 41 with react-native-unimodules 0.13.3 OK

> Task :unimodules-react-native-adapter:compileReleaseJavaWithJavac FAILED

* What went wrong:
Execution failed for task ':unimodules-react-native-adapter:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
        "expo": "^42.0.3",
        "expo-camera": "~11.2.2",
        "expo-constants": "~11.0.1",
        "expo-document-picker": "~9.2.4",
        "expo-file-system": "~11.1.3",
        "expo-font": "~9.2.1",
        "expo-haptics": "~10.1.0",
        "expo-image-manipulator": "~9.2.2",
        "expo-image-picker": "~10.2.2",
        "expo-in-app-purchases": "^10.2.0",
        "expo-linear-gradient": "~9.2.0",
        "expo-local-authentication": "~11.1.1",
        "expo-network": "~3.2.0",
        "expo-secure-store": "~10.2.0",
        "expo-sharing": "~9.2.1",
        "expo-splash-screen": "~0.11.2",
        "expo-status-bar": "~1.0.4",
        "expo-updates": "~0.8.3",
        "expo-web-browser": "~9.2.0",
        "react-native-unimodules": "^0.14.6",

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.