Gradle基础

发布时间:2022-07-05 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Gradle基础脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. 在 Gradle 中,@aar 意味着 “Artifact Only”,默认情况下将排除所有依赖。 使用 @aar 而不使用 transITive=true ,将会排除 Glide 的依赖,并导致运行时异常,例如:
java.lang.NoClaSSDefFoundError: com.bumptech.glide.load.resource.gif.GifBitmapPRovider
    at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.<init>(ByteBufferGifDecoder.java:68)
    at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.<init>(ByteBufferGifDecoder.java:54)
    at com.bumptech.glide.Glide.<init>(Glide.java:327)
    at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:445)
    at com.bumptech.glide.Glide.initializeGlide(Glide.java:257)
    at com.bumptech.glide.Glide.initializeGlide(Glide.java:212)
    at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:176)
    at com.bumptech.glide.Glide.get(Glide.java:160)
    at com.bumptech.glide.Glide.getRetriever(Glide.java:612)
    at com.bumptech.glide.Glide.with(Glide.java:684)
  1. Maven 如果使用 Maven,同样可以添加对 Glide 的依赖。再次强调,你依旧需要添加 AndROId 支持库的依赖。
<dePEndency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>glide</artifactId>
  <version>4.11.0</version>
  <type>aar</type>
</dependency>
<dependency>
  <groupId>com.GOOGLE.android</groupId>
  <artifactId>support-v4</artifactId>
  <version>r7</version>
</dependency>
<dependency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>compiler</artifactId>
  <version>4.11.0</version>
  <optional>true</optional>
</dependency>

脚本宝典总结

以上是脚本宝典为你收集整理的Gradle基础全部内容,希望文章能够帮你解决Gradle基础所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。