无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在电容android

Posted

技术标签:

【中文标题】无法确定任务 \':app:compileDebugJavaWithJavac\' 的依赖关系。在电容android【英文标题】:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. in capacitor android无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在电容android 【发布时间】:2022-01-05 12:54:21 【问题描述】:

我在构建我的电容器项目时遇到了这个错误,我尝试通过更新 sdk 但不起作用,我该如何解决这个问题?

google-services.json not found, google-services plugin not applied. Push Notifications won't 
work
WARNING:: Using flatDirs should be avoided because it doesn't support any meta-data formats.
Currently detected usages:
- repository flatDir used in: project ':app', project ':capacitor-cordova-android-plugins'
WARNING:: Please remove usages of `jcenter()` Maven repository from your build scripts and 
migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: root project 'android', project ':app', project ':capacitor- 
android', ...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment 
variable or by setting the sdk.dir path in your project's local properties file 
at 'C:\Users\giova\Desktop\testapp\android\local.properties'.[capacitor]  

[ERROR] An error occurred while running subprocess capacitor. 

【问题讨论】:

ypur 应用文件夹中有 google-services.json 吗? SDK位置是否正确? 我的应用文件夹中没有 google-services.json,我怎么知道 sdk 的正确位置是什么? 解决办法在错误本身,SDK location not found. Define location with an ANDROID_SDK_ROOT environment 【参考方案1】:

解决方案很简单,我必须正确选择项目文件夹,无论如何感谢您的帮助。

【讨论】:

以上是关于无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在电容android的主要内容,如果未能解决你的问题,请参考以下文章

无法确定任务 ':app:mergeDebugAssets' 的依赖关系

颤振错误无法确定任务':app:compileDebugJavaWithJavac'的依赖关系

无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在电容android

Flutter Notification OneSignal - 无法确定任务':app:compileDebugJavaWithJavac'的依赖关系

无法确定任务 ':launcher_assist:compileProfileAidl' 的依赖关系

Flutter Build Error:无法确定任务':app:compileDebugJavaWithJavac的依赖关系