reddr/LibScout

Unable to compile

Closed this issue · 2 comments

I pulled the newest commit and tried to recompile the project, but i get failure messages from the java compiler.

clean:
[delete] Deleting directory /home/markus/bachelor/tools/LibScout/bin
[delete] Deleting directory /home/markus/bachelor/tools/LibScout/build
compile:
[mkdir] Created dir: /home/markus/bachelor/tools/LibScout/bin
[echo] Using Java version 1.8.
[javac] Compiling 65 source files to /home/markus/bachelor/tools/LibScout/bin
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:22: error: cannot find symbol
[javac] import android.util.TypedValue;
[javac] ^
[javac] symbol: class TypedValue
[javac] location: package android.util
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:28: error: cannot find symbol
[javac] import android.util.TypedValue;
[javac] ^
[javac] symbol: class TypedValue
[javac] location: package android.util
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:215: error: cannot find symbol
[javac] if (valueType!=TypedValue.TYPE_REFERENCE) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:288: error: cannot find symbol
[javac] if (valueType==TypedValue.TYPE_STRING) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:303: error: cannot find symbol
[javac] if (valueType==TypedValue.TYPE_FLOAT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:313: error: cannot find symbol
[javac] if (valueType>=TypedValue.TYPE_FIRST_INT &&
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:314: error: cannot find symbol
[javac] valueType<=TypedValue.TYPE_LAST_INT)
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/android/content/res/AXmlResourceParser.java:328: error: cannot find symbol
[javac] if (valueType==TypedValue.TYPE_REFERENCE) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXmlResourceParser
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:129: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_STRING) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:132: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_ATTRIBUTE) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:135: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_REFERENCE) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:138: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_FLOAT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:141: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_INT_HEX) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:144: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_INT_BOOLEAN) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:147: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_DIMENSION) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:149: error: cannot find symbol
[javac] DIMENSION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK];
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:151: error: cannot find symbol
[javac] if (type==TypedValue.TYPE_FRACTION) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:153: error: cannot find symbol
[javac] FRACTION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK];
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:155: error: cannot find symbol
[javac] if (type>=TypedValue.TYPE_FIRST_COLOR_INT && type<=TypedValue.TYPE_LAST_COLOR_INT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:155: error: cannot find symbol
[javac] if (type>=TypedValue.TYPE_FIRST_COLOR_INT && type<=TypedValue.TYPE_LAST_COLOR_INT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:158: error: cannot find symbol
[javac] if (type>=TypedValue.TYPE_FIRST_INT && type<=TypedValue.TYPE_LAST_INT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/AXMLPrinter.java:158: error: cannot find symbol
[javac] if (type>=TypedValue.TYPE_FIRST_INT && type<=TypedValue.TYPE_LAST_INT) {
[javac] ^
[javac] symbol: variable TypedValue
[javac] location: class AXMLPrinter
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: /home/markus/bachelor/tools/LibScout/src/pxb/android/axml/StringItems.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 22 errors

I "solved" the problem by adding the android.jar from the Android SDK to classpath. I recommend adding a hint into the readme.

reddr commented

Sorry for the delay (vacations).

I just reproduced the problem. Apparently, lib/android-xml.jar was missing the TypedValue class causing the compilation to fail. I updated the jar. In the long run, rewriting the build process is on my todo list to fetch dependencies from remote repos (if possible). Adding the SDK to the classpath is then the preferred option.