简体   繁体   English

找不到 arguments 的方法 compile()... nativescript 和 nativescript-aws

[英]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-androidnode_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.propertiesplatforms/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:到目前为止我尝试过的事情:

  • changed versions of nativescript nativescript 的更改版本
  • change versions of tns-android更改 tns-android 的版本
  • remove tns-android and replace with @nativescript/android删除 tns-android 并替换为 @nativescript/android

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.

相关问题 在 Flutter 中找不到 arguments 的方法实现() - Could not find method implementation() for arguments in Flutter 找不到 arguments [com.google.gms.google-services] 的方法 id() - Could not find method id() for arguments [com.google.gms.google-services] > 在 org.gradle.api.Project - > Could not find method apply() for arguments [com.google.gms.google-services] on project ':app' of type org.gradle.api.Project 如何使用 @nativescript/firebase-auth 重新认证 - How to reauthenticate with @nativescript/firebase-auth 如何仅启用对我的 nativescript 应用程序的 firestore 数据访问? - How to enable access of firestore data to my nativescript app only? C# AWS Lambda Function - 找不到文件名为“LambdaTest、Culture=neutral、PublicKeyToken=null”的指定处理程序程序集 - C# AWS Lambda Function - Could not find the specified handler assembly with the file name 'LambdaTest, Culture=neutral, PublicKeyToken=null' 无法使用 rusoto 编译 Rust AWS Lambda - Unable to compile Rust AWS Lambda using rusoto AWS 上的 RSelenium:无法确定服务器状态 - RSelenium on AWS: Could not determine server status GitLab - 找不到“单声道”主机 - GitLab - Could not find 'mono' host Laravel 迁移未连接 AWS-RDS postgres(找不到驱动程序...)。 PDO 已经安装。 如何解决? - Laravel migrations is not connecting AWS-RDS postgres (could not find driver ...). PDO already installed. How to solve that?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM