1

I'm trying to integrate a chatbot on my Pepper robot using Kotlin on Android Studio. I just follow this tutorial step by step.

Testing your Dialogflow agent in standalone

But when I execute this in Kotlin REPL(in module data):

import com.softbankrobotics.chatwithdialogflow.data.DialogflowDataSource
import java.io.File
val stream = File("C:/Users/yuhliu/ChatWithDialogflow/app/src/main/res/raw/credentials.json").inputStream()
val dataSource = DialogflowDataSource(stream)
dataSource.detectIntentTexts("sois intelligent", "my-test-session", "fr")

I got this error

error: unresolved reference: softbankrobotics import com.softbankrobotics.chatwithdialogflow.data.DialogflowDataSource

My project directory is something like this: Project Directory

I'm new to Kotlin. Do you have any idea what's going wrong here?

Ramesh R
  • 7,009
  • 4
  • 25
  • 38

1 Answers1

0

On first opening the Kotlin REPL, you might get:

You’re running the REPL with outdated classes: Build module 'data' and restart

... clicking on that will reload the REPL and the import should work.

(I tried the same as you and had the same error, and the import worked after reload)

Emile
  • 2,946
  • 2
  • 19
  • 22