JNI在Brother SDK上的应用程序中检测到错误

编程入门 行业动态 更新时间:2024-10-15 06:14:06
本文介绍了JNI在Brother SDK上的应用程序中检测到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在我的应用程序中的Brother SDK中打印图像.

Im trying to print a image in Brother SDK in my app.

这是我的代码:

`myPrinterInfo = myPrinter.getPrinterInfo(); myPrinterInfo.printerModel = PrinterInfo.Model.QL_810W; myPrinterInfo.port = PrinterInfo.Port.NET; myPrinterInfo.printMode = PrinterInfo.PrintMode.FIT_TO_PAGE; myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM; myPrinterInfo.labelNameIndex = 5; myPrinterInfo.isAutoCut = false; myPrinterInfo.isCutAtEnd = false; myPrinterInfo.orientation = PrinterInfo.Orientation.PORTRAIT; myPrinterInfo.valign = PrinterInfo.VAlign.TOP; myPrinterInfo.align = PrinterInfo.Align.LEFT; myPrinterInfo.halftone = PrinterInfo.Halftone.THRESHOLD; myPrinterInfo.ipAddress = "192.168.1.146"; myPrinterInfo.thresholdingValue = 127; myPrinterInfo.pjCarbon = false; myPrinterInfo.pjDensity = 5; myPrinterInfo.pjFeedMode = PrinterInfo.PjFeedMode.PJ_FEED_MODE_FIXEDPAGE; myPrinterInfo.pjPaperKind = PJ_CUT_PAPER; myPrinterInfo.rollPrinterCase = PrinterInfo.PjRollCase.PJ_ROLLCASE_OFF; myPrinterInfo.paperPosition = PrinterInfo.Align.CENTER; myPrinterInfo.numberOfCopies = 1;

我正在使用62mmx100mm的纸卷,却收到此错误消息:

Im using the 62mmx100mm paper roll and I got this error message:

JNI在应用程序中检测到错误:GetStringUTFChars收到了NULL jstring08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:调用GetStringUTFChars08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:来自boolean com.brother.ptouch.sdk.JNIWrapper.writeByteInFile(int [],int,java.lang.String,boolean)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:"AsyncTask#1" prio = 5 tid = 10可运行08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:| |group ="main" sCount = 0 dsCount = 0 obj = 0x12c99460 self = 0xe959450008-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:| |sysTid = 31584 nice = 10 cgrp = bg_non_interactive sched = 0/0 handle = 0xe0b6593008-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:| |状态= R schedstat =(80462688 29252686 258)utm = 5 stm = 3核心= 2 HZ = 10008-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:| |stack = 0xe0a63000-0xe0a65000 stackSize = 1038KB08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:| |持有的互斥锁="mutator lock"(共享持有)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#00 pc 0035adcf/system/lib/libart.so(_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv + 126)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#01 pc 0033bdeb/system/lib/libart.so(_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE + 138)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#02 pc 0024ef71/system/lib/libart.so( ZN3art9JavaVMExt8JniAbortEPKcS2 +900)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#03 pc 0024f607/system/lib/libart.so(_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list + 54)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#04 pc 000fbe5d/system/lib/libart.so(_ZN3art11ScopedCheck6AbortFEPKcz + 28)08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art:native:#05 pc 001003b9/system/lib/libart.so(_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95 + 2676)08-10 17:33:18.883 31333-31584/br.squarebits.brothertest E/art:native:#06 pc 00108cd5/system/lib/libart.so(_ZN3art8CheckJNI17GetStringUTFCharsEP7_JNIEnvP8_jstringPh + 376)

JNI DETECTED ERROR IN APPLICATION: GetStringUTFChars received NULL jstring 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: in call to GetStringUTFChars 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: from boolean com.brother.ptouch.sdk.JNIWrapper.writeByteInFile(int[], int, java.lang.String, boolean) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: "AsyncTask #1" prio=5 tid=10 Runnable 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: | group="main" sCount=0 dsCount=0 obj=0x12c99460 self=0xe9594500 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: | sysTid=31584 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xe0b65930 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: | state=R schedstat=( 80462688 29252686 258 ) utm=5 stm=3 core=2 HZ=100 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: | stack=0xe0a63000-0xe0a65000 stackSize=1038KB 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: | held mutexes= "mutator lock"(shared held) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #00 pc 0035adcf /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+126) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #01 pc 0033bdeb /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #02 pc 0024ef71 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+900) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #03 pc 0024f607 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #04 pc 000fbe5d /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28) 08-10 17:33:18.882 31333-31584/br.squarebits.brothertest E/art: native: #05 pc 001003b9 /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+2676) 08-10 17:33:18.883 31333-31584/br.squarebits.brothertest E/art: native: #06 pc 00108cd5 /system/lib/libart.so (_ZN3art8CheckJNI17GetStringUTFCharsEP7_JNIEnvP8_jstringPh+376)

如果有人知道如何解决它,请帮助我:(

If anyone knows how to fix it, please help me :(

推荐答案

我今天也遇到了类似的问题,结果是未授予android.permission.WRITE_EXTERNAL_STORAGE权限.如果您运行的是Android 6或更高版本,请检查您的运行时权限写入外部存储.在清单中声明许可是不够的.兄弟文档在其手册的末尾对此进行了提示.

I had a similar problem today, it turns out the android.permission.WRITE_EXTERNAL_STORAGE permission was not granted. If you are running on and Android 6 or greater, check your run time permissions for writing to the external storage. Declaring the permission in the manifest is not enough. The brother documentation hints at this at the end of their manual.

8.3.Android 6兼容性自Android 6.0起,安装后允许用户更改应用程序的权限.允许必须授予访问Android外部存储的权限才能使用此功能应用程序.

8.3. Android 6 compatibility Since Android 6.0, Users are allowed to change the application’s permissions after installation. Permission to access Android external storage must be granted to use this application.

更多推荐

JNI在Brother SDK上的应用程序中检测到错误

本文发布于:2023-07-14 10:10:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104065.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   检测到   错误   JNI   Brother

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!