我试图在我的Android应用程序中使用AWS Amplify设施。我的gradle无法建立,并显示错误。
这是我的应用程式:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.example.azuretest"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.2.0-alpha02'
    implementation 'com.amplifyframework:core:0.9.0'
    implementation 'com.amplifyframework:aws-api:0.9.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}


这是我的项目gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.60'
    repositories {
        google()
        jcenter()
        mavenCentral()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.amplifyframework:amplify-tools-gradle-plugin:0.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
apply plugin: 'com.amplifyframework.amplifytools'

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


这是错误:
F:\ AzureTest \ amplify-gradle-config.json(系统找不到指定的文件)
注意:我是这个平台上的新手,很抱歉如果我违反提问的规程。

最佳答案

在创建应用程序之后,您一定错过了一步。请参阅以下文档中的步骤3:

https://aws-amplify.github.io/docs/android/start


对于a部分。关于amplify configure,请确保在您应用的根目录中运行该文件。 (在您的情况下为F:\ AzureTest)
确保执行b部分。在您的Android Studio工具栏中

关于android - amplify-gradle-config.json(系统找不到指定的文件),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59444049/

10-12 01:15