but when it running to the cordova.plugins.bixolonPrint.printBitmap(successCallback, errorCallback, {… part, it said cordova is not defined. did i miss something while building this widget? any help would be nice.">   but when it running to the cordova.plugins.bixolonPrint.printBitmap(successCallback, errorCallback, {… part, it said cordova is not defined. did i miss something while building this widget? any help would be nice.">   but when it running to the cordova.plugins.bixolonPrint.printBitmap(successCallback, errorCallback, {… part, it said cordova is not defined. did i miss something while building this widget? any help would be nice.">
cordova is not defined - Mendix Forum

cordova is not defined

0

_printerbixolon: function(base64String,num1,num2,num3){
            logger.debug(this.id + "._printerbixolon");
            cordova.plugins.bixolonPrint.printBitmap(successCallback, errorCallback, {
            base64Image: base64String, //base64 string
            width: num1, //width 
            brightness: num2, // 0 to 100 (Bixolon recommeded 13 to 88)
            alignment: num3,
            });
            function successCallback(e) {alert('success')}
            function errorCallback(e) {alert('error' + e);}
        },

 

 

hello everyone

i am trying to use a cordova plugin to build a widget here.

i did get my plugin my right i guess

<gap:plugin name="cordova-plugin-bixolon-printer" source="npm"/>
<gap:plugin name="cordova-promise-polyfill" source="npm"/>

 

but when it running to the cordova.plugins.bixolonPrint.printBitmap(successCallback, errorCallback, {… part, it said cordova is not defined.

did i miss something while building this widget? any help would be nice.

asked
3 answers
0

any advice would be nice 

answered
0

several errors occured during building an app for .apk file while using phonegap and the problem come from my custom widget that using cordova plugin

it said

error: package com.bixolon.printer does not exist import com.bixolon.printer.BixolonPrinter;

and told me that several functions are missing i guess

symbol: class BixolonPrinter location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:157: error: cannot find symbol mBixolonPrinter = new BixolonPrinter(cordova.getActivity(), mHandler, null);

but i think i already put an plugin in this app already Installing "it.alfonsovinti.cordova.plugins.bixolonprint" at "1.7.1" for android

what did i miss here? any advice or help would be great

thanks in advance

printerbixolon: function(str64,n1,n2,n3)
{

 logger.debug(this.id + "._printerbixolon");

 cordova.plugins.bixolonPrint.printBitmap(successCallback, 

errorCallback,
  {

base64Image: str64, //base64 string

width: n1, //width 

brightness: n2, // 0 to 100 (Bixolon recommeded 13 to 88)

alignment: n3,

});

function successCallback(e) {alert('success')}

function errorCallback(e) {alert('error' + e);
}

this is what i am trying to use in my widget

answered
0

oh my bad that was from i using on broswer but i could not build a .apk file via phonegap

it has errors like this

:app:processArmv7DebugResources :app:generateArmv7DebugSources :app:javaPreCompileArmv7Debug :app:compileArmv7DebugJavaWithJavac/var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:44: error: package com.bixolon.printer does not exist import com.bixolon.printer.BixolonPrinter; ^ /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:144: error: cannot find symbol static BixolonPrinter mBixolonPrinter;

^ symbol: class BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:157: error: cannot find symbol mBixolonPrinter = new BixolonPrinter(cordova.getActivity(), mHandler, null);

 

^ symbol: class BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:529: error: cannot find symbol mBixolonPrinter.kickOutDrawer(BixolonPrinter.DRAWER_CONNECTOR_PIN5);

 

^ symbol: variable BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:562: error: cannot find symbol mBixolonPrinter.kickOutDrawer(BixolonPrinter.DRAWER_CONNECTOR_PIN5);

 

^ symbol: variable BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:596: error: cannot find symbol mBixolonPrinter.getPrinterId(BixolonPrinter.PRINTER_ID_FIRMWARE_VERSION);

 

^ symbol: variable BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:600: error: cannot find symbol mBixolonPrinter.getPrinterId(BixolonPrinter.PRINTER_ID_MANUFACTURER);

 

^ symbol: variable BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:604: error: cannot find symbol mBixolonPrinter.getPrinterId(BixolonPrinter.PRINTER_ID_PRINTER_MODEL);

 

^ symbol: variable BixolonPrinter

location: class BixolonPrint /var/gimlet/tmp/47128621199960/3474012/app/src/main/java/it/alfonsovinti/cordova/plugins/bixolonprint/BixolonPrint.java:608: error: cannot find symbol mBixolonPrinter.getPrinterId(BixolonPrinter.PRINTER_ID_CODE_PAGE);

answered