【发布时间】: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
标签: java android gradle capacitor