我想创建一个库和.jar文件,将其用于另一个项目,用于创建库和.jar文件,我在this教程后面,但是当我复制我的类时在库模块中我得到错误,无法解析导入android.graphics.Color 的符号颜色,对于所有其他包我得到了同样的错误,
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.util.Log;
import android.content.Context;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Typeface;
和构建
/local_dir/newFolder/../../src/main/java/com/../Utils.java
Error:(3, 23) error: package android.content does not exist
Error:(4, 27) error: package android.content.res does not exist
Error:(5, 24) error: package android.graphics does not exist
Error:(6, 24) error: package android.graphics does not exist
Error:(7, 24) error: package android.graphics does not exist
Error:(8, 33) error: package android.graphics.drawable does not exist
Error:(9, 20) error: package android.util does not exist
Error:(10, 20) error: package android.util does not exist
Error:(11, 20) error: package android.view does not exist
Error:(21, 20) error: cannot find symbol class DisplayMetrics
Error:(33, 29) error: cannot find symbol class Context
Error:(91, 37) error: cannot find symbol class Paint
Error:(95, 20) error: cannot find symbol class Rect
Error:(97, 38) error: cannot find symbol class Paint
Error:(132, 25) error: package Paint does not exist
Error:(134, 39) error: cannot find symbol class Paint
Error:(138, 39) error: cannot find symbol class Paint
Error:(138, 57) error: package Paint does not exist
Error:(143, 40) error: cannot find symbol class Paint
Error:(147, 40) error: cannot find symbol class Paint
Error:(147, 58) error: package Paint does not exist
Error:(152, 38) error: cannot find symbol class Paint
Error:(159, 20) error: cannot find symbol class Rect
Error:(168, 37) error: cannot find symbol class Paint
Error:(196, 20) error: cannot find symbol class Rect
Error:(198, 34) error: cannot find symbol class Canvas
Error:(199, 34) error: cannot find symbol class Drawable
我想创建一个库.jar文件,将其用于另一个项目,那么如何解决这个错误呢?或任何其他方式来创建库.jar文件?
答案 0 :(得分:0)
它似乎依赖于罐子不在类路径 从库中创建jar时,所有依赖类jar都应该在类路径中。