首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法获得未知属性“CLIENT_ACCESS_TOKEN”

无法获得未知属性“CLIENT_ACCESS_TOKEN”
EN

Stack Overflow用户
提问于 2018-12-27 22:28:41
回答 2查看 1.2K关注 0票数 0

我下载了这个github文件:https://github.com/abhi007tyagi/DialogflowChat,我想将API v2与我的对话框帐户连接起来。我的英语不太好,所以在读博士的时候我不容易理解。I已经可以使用API v1运行,但需要跳到API v2。需要你的帮助。

当我尝试在Android上构建这个项目时,使用这个错误

代码语言:javascript
复制
Could not get unknown property 'CLIENT_ACCESS_TOKEN' for BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=true, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[D:\Yeni inenler\Check\DialogflowChat-master2\DialogflowChat-master\build\intermediates\proguard-files\proguard-android.txt-3.2.1, D:\Yeni inenler\Check\DialogflowChat-master2\DialogflowChat-master\app\proguard-rules.pro], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.

下面是build.gradle:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.tyagiabhinav.dialogflowchat"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'String', "ClientAccessToken", CLIENT_ACCESS_TOKEN
            resValue 'string', "ClientAccessToken", CLIENT_ACCESS_TOKEN
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'String', "ClientAccessToken", CLIENT_ACCESS_TOKEN
            resValue 'string', "ClientAccessToken", CLIENT_ACCESS_TOKEN
        }
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    // Java V2
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/INDEX.LIST'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    // Dialogflow SDK dependencies
    implementation 'ai.api:sdk:2.0.7@aar'
    implementation 'ai.api:libai:1.6.12'

    // Java V2
    implementation 'com.google.cloud:google-cloud-dialogflow:0.67.0-alpha'
    // for Remote Procedure Call to avoid "No functional channel service provider found" error while creating SessionsClient
    implementation 'io.grpc:grpc-okhttp:1.15.1'
}
EN

回答 2

Stack Overflow用户

发布于 2019-06-18 17:29:23

在项目中创建与local.properties相同位置的新文件。再加上这两行:-

代码语言:javascript
复制
org.gradle.jvmargs=-Xmx1536m
CLIENT_ACCESS_TOKEN="enter_your_dialogflow_client_access_token"
票数 0
EN

Stack Overflow用户

发布于 2019-10-07 16:58:13

在项目中创建gradle.properties新文件,然后添加

代码语言:javascript
复制
CLIENT_ACCESS_TOKEN="key"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53951515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档