How to put my libraries in front of android.jar by editing build.gradle in Android-Studio

前端 未结 9 862
你的背包
你的背包 2020-12-01 07:19

First Here\'s my Java Build Path in Eclipse: \"enter

These four jars \'common.jar,core

9条回答
  •  天涯浪人
    2020-12-01 07:43

    I use the following scenario, the perfect solution!

    1. Add your XXX.jar to Library
    2. Then change the "Scope" to "Provided"
    3. Find this in your project .gradle:

      allprojects { repositories { jcenter() } }

    4. Change it to:

      allprojects { repositories { jcenter() } gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\XXX.jar') } } }

    5. In YourApplicationName.iml file, adjust the XXX.jar to top, like this

    so, it's ok!

提交回复
热议问题