[英]Could not find method compile() for arguments ... nativescript and nativescript-aws
I am rather new to nativescript and cannot wrap my head around what I am doing wrong, I come across this error message when trying to build an app using tns run android
.我是 nativescript 的新手,无法理解我做错了什么,我在尝试使用
tns run android
构建应用程序时遇到此错误消息。 This is the full error message:这是完整的错误消息:
Could not find method compile() for arguments [com.amazonaws:aws-android-sdk-core:2.6.16] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
After spending hours researching the reason for that error, I found that most answers were recommending to change compile
to implementation
.在花了几个小时研究该错误的原因后,我发现大多数答案都建议将
compile
更改为implementation
。 this isn't something I can do as the build.gradle file is created only when running the command tns run android
.这不是我能做的,因为 build.gradle 文件仅在运行命令
tns run android
时创建。
I am running nativescript 8.0.4
我正在运行
nativescript 8.0.4
My version of tns-android
in my package.json
is 6.5.3 and nativescript-aws-sdk
is 0.0.4, the of version tns-anandroid
seems to be using gradle pluggin version 5.4.1, as per the gradle-wrapper.properties
inside the tns-android
's node_modules
folder.我的
package.json
中的tns-android
版本是 6.5.3, nativescript-aws-sdk
是 0.0.4,根据里面的gradle-wrapper.properties
,版本tns-anandroid
似乎使用 gradle 插件版本 5.4.1 tns-android
的node_modules
文件夹。 see bellow:见下文:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
When running the tns run android
two folders are created inside the platforms
folder as expected运行
tns run android
时,会在platforms
文件夹内按预期创建两个文件夹
platforms
|__android
|__tempPlugin
|__nativescript_aws_sdk
The version is fine in platforms/android
with the following gradle-wrapper.properties
:该版本在具有以下
gradle-wrapper.properties
的platforms/android
中很好:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
I The error originates from platforms/tempPlugin/nativescript_aws_sdk/build.gradle
upon checking the gradle-wrapper.properties
the version shows gradle pluggin version 5.4.1:我检查 gradle-wrapper.properties 时,错误源自
platforms/tempPlugin/nativescript_aws_sdk/build.gradle
gradle-wrapper.properties
版本显示 gradle 插件版本 5.4.1:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
I am aware that compile
has been removed from gradle from v7.我知道
compile
已从 v7 的 gradle 中删除。
Things I've tried this far:到目前为止我尝试过的事情:
What is the walk around this problem?解决这个问题的方法是什么?
The nativescript-aws-sdk
plugin( https://github.com/triniwiz/nativescript-aws-sdk ) uses old deprecated compile gradle keyword in its include.gradle
(as of now https://github.com/triniwiz/nativescript-aws-sdk/commit/9901b611ebd620c166bfabebb9f136e8fa07597d ) nativescript-aws-sdk
插件 ( https://github.com/triniwiz/nativescript-aws-sdk ) 在其include.gradle
中使用旧的已弃用的编译关键字 gradle (截至目前https://github.com/triniwiz/nativescript -aws-sdk/提交/9901b611ebd620c166bfabebb9f136e8fa07597d )
In node_modules/nativescript-aws-sdk/platforms/android/include.gradle
replace:在
node_modules/nativescript-aws-sdk/platforms/android/include.gradle
替换:
dependencies {
compile 'com.amazonaws:aws-android-sdk-core:2.6.16'
compile 'com.amazonaws:aws-android-sdk-s3:2.6.16'
compile 'com.amazonaws:aws-android-sdk-cognito:2.6.16'
}
with和
dependencies {
implementation 'com.amazonaws:aws-android-sdk-core:2.6.16'
implementation 'com.amazonaws:aws-android-sdk-s3:2.6.16'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.6.16'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.