2017-09-04 58 views
0

我正在使用IBM Watson Mobile App的自动生成示例,但是当我尝试运行它时,它在以下代码部分中显示错误。我发现了类似的错误,但我认为这是另一回事。Watson对话自动生成Android应用程序 - '未知模式字符'X''

public ServiceCall<MessageResponse> message(String workspaceId, MessageRequest request) { 
Validator.isTrue((workspaceId != null) && !workspaceId.isEmpty(), "'workspaceId' cannot be null or empty"); 

RequestBuilder builder = RequestBuilder.post(String.format(PATH_MESSAGE, workspaceId)); 
builder.query(VERSION_PARAM, versionDate); 
if (request != null) { 
    //the error shows here 
    builder.bodyJson(GsonSingleton.getGson().toJsonTree(request).getAsJsonObject()); 
} else { 
    builder.bodyJson(new JsonObject()); 
} 
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(MessageResponse.class)); 
} 

以下是我的build.gradle文件:

apply plugin:'base' 
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 

    defaultConfig { 
     applicationId "com.ibm.watson_conversation" 
     minSdkVersion 19 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     manifestPlaceholders = ['appIdRedirectScheme': android.defaultConfig.applicationId] 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    lintOptions { 
     warning 'InvalidPackage' 
     abortOnError false 
    } 
} 

dependencies { 
    compile ('com.ibm.mobilefirstplatform.clientsdk.android:core:[2.0.0,3.0.0)') 
    compile 'com.ibm.watson.developer_cloud:conversation:3.8.0' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:25.1.0' 
    compile 'com.android.support:design:25.1.0' 
} 

回答

1

问题被固定在3.9.0。

你只需要更新的依赖版本是3.9.1

compile 'com.ibm.watson.developer_cloud:conversation:3.9.1' 
相关问题