Hello everyone,
I am new to evothings but I used the BLE Scan example to make an android app with cordova to activate the bluetooth and list the active devices. But when I click on "Start Scan". It shows me the following message in the android logcat on Eclipse:
Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
-
- Posts: 1
- Joined: 15:36, 15 Jul 2015
Re: Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
I suspect that the BLE plugin is missing. Add it by running this command:
cordova plugin add https://github.com/evothings/cordova-ble
cordova plugin add https://github.com/evothings/cordova-ble
-
- Posts: 1
- Joined: 08:26, 19 Sep 2015
Re: Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
Hello:
I'm encountering a similar problem. I've installed the ble plugin.
To summarize the problem.
1. The app runs perfectly well when run from the Evothings client app.
2. The cordova built app works otherwise fine but for the functionality when a bluetooth connection is requested.
3. When a connection is requested, evothings.rfduinoble.close() is called, which in turn calls evothings.easyble.stopScan(), which in turn calls evothings.ble.stopScan().
4. Where is this last function i.e, evothings.ble.stopScan(), as the error occurs at this stage.
5. ble.js that comes with the plugin does not have the definition of this function.
So perhaps, we are missing something.
Thank you.
I'm encountering a similar problem. I've installed the ble plugin.
To summarize the problem.
1. The app runs perfectly well when run from the Evothings client app.
2. The cordova built app works otherwise fine but for the functionality when a bluetooth connection is requested.
3. When a connection is requested, evothings.rfduinoble.close() is called, which in turn calls evothings.easyble.stopScan(), which in turn calls evothings.ble.stopScan().
4. Where is this last function i.e, evothings.ble.stopScan(), as the error occurs at this stage.
5. ble.js that comes with the plugin does not have the definition of this function.
So perhaps, we are missing something.
Thank you.
Re: Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
ble.js contains "exports.stopScan". The "exports" part gets converted by cordova to "evothings.ble".
Let's check if you added the plugin properly. Run "dir plugins" (or "ls plugins" on mac/linux) and post the output.
Let's check if you added the plugin properly. Run "dir plugins" (or "ls plugins" on mac/linux) and post the output.
-
- Posts: 7
- Joined: 12:49, 19 Nov 2015
Re: Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
I think I'm having exactly the same issue on iOS, covered in a new thread here, if anyone comes here (not solved yet): viewtopic.php?f=8&t=1847
I'm pretty sure the plugin is installed correctly. If I ls plugins I have fetch.json, ios.json and cordova-plugin-ble, as well as cordova-plugin-whitelist. The plugin is also then present in some form in /platforms/ios/www and /platforms/ios/platform_www
I'm pretty sure the plugin is installed correctly. If I ls plugins I have fetch.json, ios.json and cordova-plugin-ble, as well as cordova-plugin-whitelist. The plugin is also then present in some form in /platforms/ios/www and /platforms/ios/platform_www
Re: Uncaught TypeError: cannot call method 'stopScan' of 'undefined' source: file:///android_asset/www/app.js
@josephclawrence
One thing to try is building the Evothings Viewer app and see if that works. Build instructions are provided here:
https://github.com/evothings/evothings-viewer
Evothings Viewer is easier to build than Evothings Client (and works with Evothings 2.0). The build depends only on Cordova.
Modify the list of plugins in this file:
https://github.com/evothings/evothings- ... ckage.json
You can for example remove plugins you do not need, and add ones not included.
Let me know ho it goes!
Best, Mikael
One thing to try is building the Evothings Viewer app and see if that works. Build instructions are provided here:
https://github.com/evothings/evothings-viewer
Evothings Viewer is easier to build than Evothings Client (and works with Evothings 2.0). The build depends only on Cordova.
Modify the list of plugins in this file:
https://github.com/evothings/evothings- ... ckage.json
You can for example remove plugins you do not need, and add ones not included.
Let me know ho it goes!
Best, Mikael
Return to “Questions and answers”
Who is online
Users browsing this forum: No registered users and 2 guests