用android-studio 写了一个java application,依赖了fastjson,打包成jar的时候发现 fastjson没有导出,导致了 :java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSONObject
android-studio 中配置Artifacts的功能好像被阉割了,所以能不能用gradle配置,实现打包的时候导出 fastjson 依赖。
ps:项目中同时又Android 和 Java,改用 idea有点不方便(我知道idea也能开发Android)
Later I wrote the task myself and realized this function
Depend on fastjson in the build.gradle file in the project that relies on this jar, such as