任务 ':expo-permissions:compileDebugKotlin' 执行失败

Execution failed for task #39;:expo-permissions:compileDebugKotlin#39;(任务 :expo-permissions:compileDebugKotlin 执行失败)

本文介绍了任务 ':expo-permissions:compileDebugKotlin' 执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 React Native 应用程序,其中包含一些 expo 库(裸工作流).我已经成功使用了 expo-location,但现在在我还安装了 expo-camera 之后,应用程序将不再使用 npm run android 构建,还没在ios上试过.

I am working on a React Native app where I included some expo libraries (bare workflow). I had successfully used expo-location, but now after I installed also expo-camera, the app won't build anymore with npm run android, did not try yet on ios.

它会在 :expo-permissions:compileDebugKotlin 步骤崩溃.

我确实在另一个论坛上发现了问题,他们说将 buildToolsVersionbuild.gradle 更新为 29.0.2 但它已经在 29.0.2 上.然后我更新了 react-native-unimodules ,这是使用 expo 库所必需的,并且包含 expo 权限.它没有用.现在,我当前的库版本是:

I did find the problem on another forum, they were saying to update the buildToolsVersion from build.gradle to 29.0.2 but it already was on 29.0.2. Then I updated react-native-unimodules which is required to use expo libraries and contains expo-permissions. It didn't work. Right now, my current versions of libs are:

"react-native-unimodules": "^0.12.0"

"expo-permissions": "~10.0.0"

"expo-camera": "^9.1.1"

你有什么想法吗?有人也遇到过这个问题吗?

Do you have any ideas? Did someone met this problem also?

谢谢

更详细的堆栈跟踪是这样的:

A more elaborate stacktrace is this:

Task :expo-permissions:compileDebugKotlin FAILED

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.2/userguide/command_line_interface.html#sec:command_line_warnings
153 actionable tasks: 4 executed, 149 up-to-date
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (16, 40): Unresolved reference: PermissionAwareActivity
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (170, 17): Unresolved reference: PermissionAwareActivity
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (236, 19): Unresolved reference: PermissionAwareActivity
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (237, 62): Too many arguments for public final fun requestPermissions(@NonNull p
0: Array<(out) String!>, p1: Int): Unit defined in android.app.Activity
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (237, 64): Cannot infer a type for this parameter. Please specify it explicitly.
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (237, 77): Cannot infer a type for this parameter. Please specify it explicitly.
e: app
ode_modulesexpo-permissionsandroidsrcmainjavaexpomodulespermissionsPermissionsService.kt: (237, 97): Cannot infer a type for this parameter. Please specify it explicitly.

FAILURE: Build failed with an exception.

推荐答案

你可能不想拿别人在线引用的版本,而是取你本地安装的版本,具体取决于何时您上次更新了您的 Android SDK.

You may not want to take the version being referenced by others online, but, instead take the version of what you have installed locally, which would vary depending on when you last updated your Android SDK.

在 Windows 上,您可以查看您的 SDK 版本(工具版本):

On Windows you can look up your SDK version (tools version):

dir %ANDROID_SDK_ROOT%uild-tools

可能 *nix 系统会有类似的 SDK 路径(未检查):

Probably *nix systems will have a similar SDK path (did not check):

ls -al $ANDROID_SDK_ROOTuild-tools

您可能需要更新它以匹配与您所定位设备的平台相对应的 SDK.就我而言,我的目标是 Platform 29,在我的/build-tools/目录中,我找到了一个/29.0.3/".目录(以及其他).. 所以,我编辑了我的 build.gradle:

You would probably want to update this to match the SDK corresponding to the Platform of the device you are targeting. In my case I am targeting Platform 29, and in my /build-tools/ directory I find a "/29.0.3/" directory (among others).. So, I edited my build.gradle:

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 29
        compileSdkVersion = 29
        targetSdkVersion = 29

.. 编辑后,我能够再次成功构建并部署到我的 Android 设备.

.. after my edit I was able to successfully build and deploy to my Android device again.

您可能还需要更新您的 SDK.我在一个构建了一年多的项目中遇到了这种情况,然后我更新了 expo-gl-cpp 包(以及其他一些包)并立即遇到了同样的问题/错误.我必须为 Platform 29 更新我的 SDK,然后修改我的 build.gradle 设置,然后才能再次启动并运行.我使用 Android Studio 来管理我的 SDK,它都是点击式的,易于使用.我不会用它来做任何其他事情,从来没有需要.

You may need to update your SDK, as well. I experienced this on a project which was building just fine for over a year, then I updated expo-gl-cpp package (and a few others) and immediately had the same problem/error you are having. I had to update my SDK for Platform 29 and then modify my build.gradle settings before I was up and running again. I use Android Studio to manage my SDKs, it's all point-and-click, easy to use. I don't use it for anything else, never had the need.

HTH!

这篇关于任务 ':expo-permissions:compileDebugKotlin' 执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:任务 ':expo-permissions:compileDebugKotlin' 执行失败

基础教程推荐