问题描述
我使用了littleMonkey QRScanner库,但是它可以在模拟器中使用(显示不支持扫描仪的对话框)。但是,当我构建项目时,它会产生构建错误。
PS:我删除了所有构建提示并再次刷新了lib,但是仍然存在相同的问题。
我按照
例如:它没有读取以下imei条形码
Update 2:
Got the camera permission through native code that triggers the camera permission in marshmallow device but that doesnot solve the camera permission denial issue
NativeImpl file:
$b$ b
ActivityCompat.requestPermissions((android.app.Activity) Lenovo.getContext(), new String[]{Manifest.permission.CAMERA},0);
I have applied Shai’s patch and rebuilt the library. You’ll be able to update the lib in via the Codename One Settings’ Extensions section.
This also required a small change to the build server which will released in the next update (this Friday).即you’ll have to wait until Friday to send a build.
I've used littleMonkey QRScanner library but it works in simulator(shows scanner not supported dialog box). But when I build the project it gives build error.
PS: I've deleted all build hints and refresh lib again but still same problem.I've kept cn1-codescan.cn1lib and QRScanner.cn1lib as suggested in https://github.com/littlemonkeyltd/QRScanner
My code:
import org.littlemonkey.qrscanner.QRScanner;
import com.codename1.ext.codescan.ScanResult;
QRScanner.scanQRCode(new ScanResult() {
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
Dialog.show("Completed", contents, "OK", null);
}
public void scanCanceled() {
Dialog.show("Cancelled", "Scan Cancelled", "OK", null);
}
public void scanError(int errorCode, String message) {
Dialog.show("Error", message, "OK", null);
}
});
Build error:
Try: Run with --debug option to get more log output.
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processDebugManifest'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151) at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: java.lang.RuntimeException: Manifest merger failed : Attribute activity#com.dm.zbar.android.scanner.ZBarScannerActivity@label value=(@string/app_name) from AndroidManifest.xml:25:114-146 is also present at [:ZBarScannerLibrary:] AndroidManifest.xml:18:13-36 value=(Scanner). Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:25:3-149 to override. at com.android.builder.core.AndroidBuilder.mergeManifests(AndroidBuilder.java:686) at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:65) at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 68 more
update 1: added in codenameone_settings.properties file but still build errors
codename1.arg.android.xapplication=<activity android\:name\="com.dm.zbar.android.scanner.ZBarScannerActivity" android\:screenOrientation\="landscape" android\:label\="@string/app_name" tools\:replace\="android\:label" />
New build errors after update1
When unzipping library ':ZBarScannerLibrary:, either group, name or version is empty
When unzipping library ':ZBarScannerLibrary:, either group, name or version is empty
When unzipping library ':ZBarScannerLibrary:, either group, name or version is empty
When unzipping library ':ZBarScannerLibrary:, either group, name or version is empty
Using incremental javac compilation.
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Cannot read packageName from /tmp/build3235388660761476489xxx/ScannerTest/src/main/AndroidManifest.xml
* Try:
Run with --debug option to get more log output.
* Exception is:
java.lang.RuntimeException: Cannot read packageName from /tmp/build3235388660761476489xxx/ScannerTest/src/main/AndroidManifest.xml
at com.android.builder.core.VariantConfiguration.getPackageFromManifest(VariantConfiguration.java:999)
at com.android.builder.core.VariantConfiguration.getOriginalApplicationId(VariantConfiguration.java:780)
at com.android.build.gradle.tasks.GenerateBuildConfig$ConfigAction$_execute_closure1.doCall(GenerateBuildConfig.groovy:167)
at com.android.build.gradle.tasks.GenerateBuildConfig$ConfigAction$_execute_closure1.doCall(GenerateBuildConfig.groovy)
at org.gradle.api.internal.ConventionAwareHelper$2.getValue(ConventionAwareHelper.java:84)
at org.gradle.api.internal.ConventionAwareHelper$MappedPropertyImpl.getValue(ConventionAwareHelper.java:136)
at org.gradle.api.internal.ConventionAwareHelper.getConventionValue(ConventionAwareHelper.java:114)
at com.android.build.gradle.tasks.GenerateBuildConfig_Decorated.getBuildConfigPackageName(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo$4.create(AnnotationProcessingTaskFactory.java:458)
at org.gradle.util.SingleMessageLogger.whileDisabled(SingleMessageLogger.java:166)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo.getValue(AnnotationProcessingTaskFactory.java:456)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$Validator.validate(AnnotationProcessingTaskFactory.java:277)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Update 2: error log about camera permission in marshmallow device samsung J7 prime
02-18 08:35:56.338: E/SamsungIME(25272): isHWKeyboardConnected() = false --> false
02-18 08:35:56.388: E/Qmage(27688): isQIO : stream is not a QIO file
02-18 08:35:56.388: E/Qmage(27688): isQIO : stream is not a QIO file
02-18 08:35:56.408: E/Qmage(27688): isQIO : stream is not a QIO file
02-18 08:35:56.458: E/CameraService(2255): Permission Denial: can't use the camera pid=1563, uid=10244
02-18 08:35:56.458: E/AndroidRuntime(1563): FATAL EXCEPTION: main
02-18 08:35:56.458: E/AndroidRuntime(1563): Process: com.lenovo.capitaleyenepal, PID: 1563
02-18 08:35:56.458: E/AndroidRuntime(1563): java.lang.RuntimeException: Unable to resume activity {com.lenovo.capitaleyenepal/com.dm.zbar.android.scanner.ZBarScannerActivity}: java.lang.RuntimeException: Fail to connect to camera service
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4225)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4327)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3426)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.access$1100(ActivityThread.java:229)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.os.Handler.dispatchMessage(Handler.java:102)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.os.Looper.loop(Looper.java:148)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.main(ActivityThread.java:7406)
02-18 08:35:56.458: E/AndroidRuntime(1563): at java.lang.reflect.Method.invoke(Native Method)
02-18 08:35:56.458: E/AndroidRuntime(1563): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
02-18 08:35:56.458: E/AndroidRuntime(1563): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
02-18 08:35:56.458: E/AndroidRuntime(1563): Caused by: java.lang.RuntimeException: Fail to connect to camera service
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.hardware.Camera.<init>(Camera.java:568)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.hardware.Camera.open(Camera.java:423)
02-18 08:35:56.458: E/AndroidRuntime(1563): at com.dm.zbar.android.scanner.ZBarScannerActivity.onResume(ZBarScannerActivity.java:75)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1287)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.Activity.performResume(Activity.java:7015)
02-18 08:35:56.458: E/AndroidRuntime(1563): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4214)
02-18 08:35:56.458: E/AndroidRuntime(1563): ... 10 more
my project properties
I have a one more question. In older devices it is reading smaller bar code reader but I need to read imei no. of mobile devices. It is a bit large. So it is not reading imei no. Do I have to do anything else to read that?
eg: it is not reading the following imei bar code
Update 2:
Got the camera permission through native code that triggers the camera permission in marshmallow device but that doesnot solve the camera permission denial issue
NativeImpl file:
ActivityCompat.requestPermissions((android.app.Activity) Lenovo.getContext(), new String[]{Manifest.permission.CAMERA},0);
I have applied Shai's patch and rebuilt the library. You'll be able to update the lib in via the Codename One Settings' Extensions section.
This also required a small change to the build server which will released in the next update (this Friday). I.e. you'll have to wait until Friday to send a build.
这篇关于LittleMonkey QRScanner库生成问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!