Expo v48构建失败,出现gradlew错误。

huangapple go评论85阅读模式
英文:

Where am I wrong ? Expo v48 build fails with gradlew error

问题

I am trying to create an APK build but getting this gradlew error

Node version: 18.16.0

command used: eas build -p android --profile preview

eas.json:

{
  "cli": {
    "version": ">= 3.14.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

end of the error file:

Here is My Package.json file.
package.json

{
  "name": "app-name",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~48.0.18",
    "expo-constants": "~14.2.1",
    "expo-splash-screen": "~0.18.2",
    "expo-status-bar": "^1.4.4",
    "react": "18.2.0",
    "react-native": "0.71.8",
    "react-native-webview": "11.26.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}
英文:

I am trying to create an APK build but getting this gradlew error

Expo v48构建失败,出现gradlew错误。

Node version: 18.16.0

command used: eas build -p android --profile preview

eas.json:

{
  "cli": {
    "version": ">= 3.14.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

end of the error file:
Expo v48构建失败,出现gradlew错误。

Here is My Package.json file.
package.json

{
  "name": "app-name",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~48.0.18",
    "expo-constants": "~14.2.1",
    "expo-splash-screen": "~0.18.2",
    "expo-status-bar": "^1.4.4",
    "react": "18.2.0",
    "react-native": "0.71.8",
    "react-native-webview": "11.26.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

答案1

得分: 0

我最终通过安装 expo-dev-client 得以解决此问题,奇怪的是 Expo 文档中并未提到构建 APK 需要 expo-dev-client

英文:

I finally got this working by installing expo-dev-client and the strange thing is that the expo documentation had not mentioned expo-dev-client is required for building APK.

huangapple
  • 本文由 发表于 2023年6月27日 19:50:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76564564.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定