Android cannot use utilcodex
through jar package import (unsolved).
Using utilcodex
in androidStudio, it can be used normally using implementation com.blankj:utilcodex:1.31.1
, but the separately downloaded jar package cannot be used normally using implementation files ('libsutilcodex-1.31.1-sources.jar')
.
For some reasons, the jar package needs to be used. Does anyone know how to solve it?
added util codex to build.gradle
added jar in build.gradle
Other jar packages can be imported normally, such as AMap2DMap_6.0.0_AMapSearch_9.7.2_AMapLocation_6.4.5_20240508.jar
, but utilcodex-1.31.1-sources
cannot be imported. I have tried many times.
You are using the source code of utilcodex
library. This JAR file is simply a zipped version of the source code and has not been compiled to use in the project. That’s why Android Studio cannot import the classes.
Option 1
You can use utilcodex-1.31.1.aar instead of source file.
Option 2
You can unzip utilcodex-1.31.1-sources.jar
file, copy all source code files from /com/blankj/utilcode
folder to your project and use it.
Option 3
You can create a library in Android Studio, copy all source code files from utilcodex-1.31.1-sources.jar
into this library and generate a usable compiled JAR file.
0