在 Android 中手动添加外部库时无法导入语句

Unable to Import statements while adding external library manually in Android

我不想使用外部库

   compile 'com.github.atomfrede:jadenticon:1.1.0'

来自 gradle。

因此我在我的 android stuidio 项目中手动添加库的所有 java 文件。(我知道这是愚蠢且耗时的)

但是,我无法像

那样使用外部导入语句(无法解决错误)
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.PNGTranscoder;
import org.apache.commons.io.FileUtils;

我知道这些不是默认的 android 或 java 类,因此可能是错误。 但是原始库如何能够使用这样的导入语句。

如何在我的项目中使用这些导入语句。

这是因为据我所知,当您将库添加为依赖项并同步 gradle 时,它还会下载库依赖项(库项目所依赖的依赖项),以便库能够访问那些导入语句。

在你的情况下,你正在尝试什么(正如你所说的那样有点愚蠢;)),你可以在 Google 中搜索那些 类 并且会找到包含这些文件的 jar 文件或独立文件本身。