任务 :expo-permissions:compileReleaseKotlin FAILED

时间:2021-01-26 14:57:45

标签: javascript android reactjs react-native expo

我想创建一个 apk 。我正在使用 expo 裸项目,我正在使用此命令为 android 创建 apk

<块引用>

cd android && ./gradlew assembleRelease

每次运行命令时都会收到此错误。 这是错误

我还尝试为样板应用程序创建 apk 并且工作正常 但是我从这个错误中得到了我之前使用过这个命令的错误

expo build:android

但是通过使用这个命令,它的尺寸很大,所以我想减小它的尺寸,这就是我使用的原因

cd android && ./gradlew assembleRelease


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-permissions:compileReleaseKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

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

Package.json

{
  "main": "index.js",
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo-google-fonts/oswald": "^0.1.0",
    "@expo-google-fonts/playfair-display": "^0.1.0",
    "@react-native-community/cli-platform-ios": "^4.13.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^5.9.2",
    "@react-native-community/slider": "^3.0.0",
    "@react-navigation/bottom-tabs": "^5.11.1",
    "@react-navigation/drawer": "^5.9.0",
    "@react-navigation/material-top-tabs": "^5.3.10",
    "@react-navigation/native": "^5.6.1",
    "@react-navigation/stack": "^5.6.2",
    "@unimodules/core": "~6.0.0",
    "base64-arraybuffer": "^0.2.0",
    "expo": "~40.0.0",
    "expo-av": "~8.7.0",
    "expo-camera": "~9.1.0",
    "expo-constants": "~9.3.3",
    "expo-file-system": "~9.3.0",
    "expo-image-picker": "~9.2.0",
    "expo-linear-gradient": "^8.4.0",
    "expo-localization": "~9.1.0",
    "expo-location": "~10.0.0",
    "expo-media-library": "~10.0.0",
    "expo-splash-screen": "~0.8.0",
    "expo-status-bar": "~1.0.3",
    "expo-updates": "~0.4.0",
    "i18n-js": "^3.8.0",
    "import": "^0.0.6",
    "localstorage-polyfill": "^1.0.1",
    "moment": "^2.29.1",
    "native-base": "^2.13.14",
    "query-string": "^6.13.7",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "~0.63.4",
    "react-native-deck-swiper": "^2.0.5",
    "react-native-dropdown-picker": "^3.7.6",
    "react-native-easy-grid": "^0.2.2",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.2",
    "react-native-material-menu": "^1.2.0",
    "react-native-paper": "^4.1.0",
    "react-native-reanimated": "~1.13.0",
    "react-native-responsive-fontsize": "^0.5.0",
    "react-native-responsive-screen": "^1.4.1",
    "react-native-safe-area-context": "~3.1.9",
    "react-native-screens": "~2.15.0",
    "react-native-size-matters": "^0.3.1",
    "react-native-step-indicator": "^1.0.3",
    "react-native-svg": "^12.1.0",
    "react-native-tab-view": "^2.15.2",
    "react-native-unimodules": "~0.12.0",
    "react-native-web": "~0.13.12",
    "react-native-webview": "^11.0.0",
    "react-navigation": "^4.4.0",
    "socket.io-client": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "babel-jest": "~25.2.6",
    "jest": "~25.2.6",
    "react-test-renderer": "~16.13.1"
  },
  "jest": {
    "preset": "react-native"
  },
  "private": true
}


1 个答案:

答案 0 :(得分:0)

对于裸工作流,您必须排除 expo-permissions 模块:

android/app/build.gradle

替换:

addUnimodulesDependencies()

addUnimodulesDependencies([exclude: ['expo-permissions']])

适用于 Podfile 中的 iOS:

替换:

use_unimodules!

use_unimodules!(exclude: ['expo-permissions'])

解决方案发布在这里:https://github.com/expo/expo/issues/10283