我从https://github.com/littlemonkeyltd/QRScanner下载了QRScanner项目 并在codenameone_library_appended.properties文件中替换“codename1.arg.android.xapplication =”行。在构建库时,它会出现以下错误。
E:\QRScanner-master\src\org\littlemonkey\qrscanner\QRScanner.java:27Stubbing
Class: E:\QRScanner-master\build\stubs\org/littlemonkey/qrscanner/NativeScanner.java
: error: package com.codename1.ext.codescan does not exist
6 warnings
import com.codename1.ext.codescan.CodeScanner;
E:\QRScanner-master\src\org\littlemonkey\qrscanner\QRScanner.java:28: error: package com.codename1.ext.codescan does not exist
import com.codename1.ext.codescan.ScanResult;
更新1:我添加了cn1-codescan.cn1lib依赖项,但存在上述问题......
-Unzipped cn1-codescan.cn1lib并将main.zip保存在lib文件夹中
- build.xml中的更改
<target name="-pre-compile">
<echo>Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support</echo>
<mkdir dir="build/tmp"/>
<javac destdir="build/tmp"
source="1.5"
target="1.5"
bootclasspath="lib/CLDC11.jar"
classpath="lib/main.zip:${javac.classpath}:${build.classes.dir}">
<src path="${src.dir}"/>
</javac>
</target>
nbproject / project.properties文件:
javac.classpath=\
${file.reference.CLDC11.jar}:\
${file.reference.CodenameOne.jar}:\
${file.reference.CodenameOne_SRC.zip}:\
${file.reference.QRScanner-override}:\
${file.reference.main.zip}
file.reference.main.zip=lib/main.zip
# Space-separated list of extra javac options
您可以在此处查看项目,看看我是否做错了什么:
https://drive.google.com/open?id=0B8ATnICIY2S8VzN0cGpwUTJLZTg
三江源