dialogflow / dialogflow-cordova-client

Cordova library for Dialogflow
Apache License 2.0
42 stars 23 forks source link

Class not found #5

Closed H0rst closed 9 years ago

H0rst commented 9 years ago

I use cordova CLI and have installed the plugin for android. But the ApiAIPlugin.init brings the error "Class not found"

Cordova 4.2.0 Cordova Android version 3.6.4

Plugins: ai.api.apiaiplugin 1.3.0 "ApiAISDKPlugin" android.support.v4 21.0.1 "Android Support v4" de.appplant.cordova.plugin.local-notification 0.7.8 "LocalNotification" org.apache.cordova.console 0.2.11 "Console" org.apache.cordova.device 0.2.12 "Device" org.apache.cordova.dialogs 0.2.11 "Notification" org.apache.cordova.file 1.3.1 "File" org.apache.cordova.file-transfer 0.4.6 "File Transfer" org.apache.cordova.globalization 0.3.1 "Globalization" org.apache.cordova.inappbrowser 0.5.2 "InAppBrowser" org.apache.cordova.network-information 0.2.13 "Network Information" org.apache.cordova.splashscreen 0.3.3 "Splashscreen"

Any idea?

xVir commented 9 years ago

Hi, H0rst!

I am trying to reproduce this problem.

xVir commented 9 years ago

@H0rst could you please attach application log here? Or any additional information about exception.

H0rst commented 9 years ago
03-12 09:34:39.592: D/CordovaActivity(9125): onMessage(spinner,stop)
03-12 09:34:39.622: D/ConnectivityManager(9125): getActiveNetworkInfo : NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "***", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false
03-12 09:34:39.622: D/CordovaNetworkManager(9125): Connection Type: wifi
03-12 09:34:39.622: D/CordovaNetworkManager(9125): Connection Extra Info: "***"
03-12 09:34:39.622: D/ConnectivityManager(9125): getActiveNetworkInfo : NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "***", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false
03-12 09:34:39.622: D/CordovaNetworkManager(9125): Connection Type: wifi
03-12 09:34:39.622: D/CordovaNetworkManager(9125): Connection Extra Info: "***"
03-12 09:34:39.622: D/CordovaActivity(9125): onMessage(networkconnection,wifi)
03-12 09:34:39.662: D/CordovaWebViewClient(9125): onPageFinished(file:///android_asset/www/index.html)
03-12 09:34:39.662: D/CordovaActivity(9125): onMessage(onPageFinished,file:///android_asset/www/index.html)
03-12 09:34:39.682: D/PluginManager(9125): exec() call to unknown plugin: ApiAIPlugin
03-12 09:34:39.692: D/Dialog(9125):  checkMirrorLinkEnabled returns : false
03-12 09:34:39.692: D/Dialog(9125): showing allowed
03-12 09:34:47.292: D/OpenGLRenderer(9125): GL error from OpenGLRenderer: 0x502
03-12 09:34:47.292: E/OpenGLRenderer(9125):   GL_INVALID_OPERATION
03-12 09:34:47.362: D/Activity(9125): #1 setTransGradationModeColor false
03-12 09:34:47.362: D/Activity(9125): #4 setTransGradationMode to false:
03-12 09:34:47.362: D/CordovaActivity(9125): Resuming the App
03-12 09:34:47.382: D/SoftKeyboardDetect(9125): Ignore this event
03-12 09:34:56.602: D/CordovaActivity(9125): Paused the application!
03-12 09:34:56.602: D/CordovaWebView(9125): Handle the pause

i think this is the problem:

03-12 09:34:39.682: D/PluginManager(9125): exec() call to unknown plugin: ApiAIPlugin

But i have no idea how to fix it. Removing and adding the plugin i have tried several times. Do i need some special SDK or API?

xVir commented 9 years ago

No, plugin is not require special SDK's...

I am trying to reproduce your issue with this steps. Could you please also try it?

cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add android
cordova plugin add ai.api.apiaiplugin
 ApiAIPlugin.init(
            {
                subscriptionKey: "6123ebe7185a4d9e94e441b7959cf2bc",
                clientAccessToken: "4040f29a2bda474f873dedf16c637afb",
                lang: "ru",
                debug: true
            },
            function () {
                alert("Init success");
            },
            function (error) {
                alert("Init error\n" + error);
            });
cordova run android

In my case I see dialog "Init success"

If in your case problem still appears please send me zipped package with created app

H0rst commented 9 years ago

Thank you. It works. So i think this is no problem with the plugin. Is a cordova problem with my app.

xVir commented 9 years ago

I tried to install plugins you have (and get such list):

ai.api.apiaiplugin 1.3.0 "ApiAISDKPlugin" android.support.v4 21.0.1 "Android Support v4" de.appplant.cordova.plugin.local-notification 0.8.1 "LocalNotification" org.apache.cordova.console 0.2.13 "Console" org.apache.cordova.device 0.3.0 "Device" org.apache.cordova.dialogs 0.3.0 "Notification" org.apache.cordova.file 1.3.3 "File" org.apache.cordova.file-transfer 0.5.0 "File Transfer" org.apache.cordova.globalization 0.3.4 "Globalization" org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser" org.apache.cordova.network-information 0.2.15 "Network Information" org.apache.cordova.splashscreen 1.0.0 "Splashscreen"

And it also works normally...

If you may publish some parts of your code I can take a look.

Thanks.