我下载了这个github文件:https://github.com/abhi007tyagi/DialogflowChat,我想将API v2与我的对话框帐户连接起来。我的英语不太好,所以在读博士的时候我不容易理解。I已经可以使用API v1运行,但需要跳到API v2。需要你的帮助。
当我尝试在Android上构建这个项目时,使用这个错误
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:
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'
}发布于 2019-06-18 17:29:23
在项目中创建与local.properties相同位置的新文件。再加上这两行:-
org.gradle.jvmargs=-Xmx1536m
CLIENT_ACCESS_TOKEN="enter_your_dialogflow_client_access_token"发布于 2019-10-07 16:58:13
在项目中创建gradle.properties新文件,然后添加
CLIENT_ACCESS_TOKEN="key"https://stackoverflow.com/questions/53951515
复制相似问题