`
- 浏览:
41364 次
- 性别:
- 来自:
济南
-
android studio 导入优先级的framework.jar 或者是core.jar
eclipse 导入framework.jar后只要设置top位置,那么eclipse编译优先使用framework.jar相对于android.jar,然而android studio设置方法不太一样,导入优先级的framework.jar,首先需要把framework.jar设置为provided,例如:provided files('jar/framework.jar') 然后再在整体的项目工程设置build.gradle 里面增加
#######################################
allprojects {
repositories {
jcenter()
}
/*//添加以下代码,使framework.jar包编译先于android.jar
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.compilerArgs.add('Xbootclasspath/p:D:\\androidstudio\\AndroidFramework\\framework.jar;D:\\androidstudio\\AndroidFramework\\core.jar') //windows环境
options.compilerArgs.add('-Xbootclasspath/p:/home/carter/android-sdk-linux/platforms/android-17/amlogic_filemanager_libs/framework.jar') //linux环境
}
}*/
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.compilerArgs.add('-Xbootclasspath/p:/home/carter/android-sdk-linux/platforms/android-17/amlogic_filemanager_libs/framework.jar')
}
}
}
@@@@@@注意 android studio 2.3版本以上 采样以下方式添加库
app build.gradle 添加以下内容
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile){
//android studio 2.3以前使用以下方式
options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\framework.jar')
//android studio 2.3以后使用
//options.compilerArgs << '-Xbootclasspath/p:app/libs/framework.jar'
}
}
}
同时需要调整framework.jar的位置 app.iml ---》把<orderEntry type="library" 移到android sdk的前面才行
@@@@@@@@@@
########################################
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
openbean.jar包, AndroidStudio 使用java.beans.*,需要导入这个jar包哦
替换sdk路径下/platforms/android-29/android.jar,能够解决在android studio 看源码部分类报红及能够正常编译项目。解决替换后报错:Failed to transform file 'android.jar' to match attributes {artifactType=...
Android Studio Bumblebee 2021.1.1 Patch 1 (android-studio-2021.1.1.21-windows.exe)大黄蜂,适用于Windows x86_64系统,是Android Studio 4.3(Android Studio Arctic Fox 2020.3.1.26新版本命名)版本之后的新...
Android Studio Bumblebee 2021.1.1 Patch 2 (android-studio-2021.1.1.22-windows.exe)大黄蜂,适用于Windows x86_64系统,是Android Studio 4.3(Android Studio Arctic Fox 2020.3.1.26新版本命名)版本之后的新...
Android Studio Dolphin (2021.3.1) Canary 3 (android-studio-2021.3.1.3-mac_arm.zip)海豚 适用于macOS Arm芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: android-studio-2021.3.1.3-...
Android Studio Giraffe 2022.3.1 Beta 1(android-studio-2022.3.1.12-windows.zip) 适用于Windows系统,文件使用WinRAR分割两个压缩包,必须一起下载使用。 Android Studio Giraffe(android-studio-2022.3.1.12...
Android Studio Chipmunk Canary 2 (android-studio-2021.2.1.2-windows.zip) 花栗鼠 只适用于Windows系统。 Android Studio 版本倒序排列: Android Studio Chipmunk 2021.2.1 花栗鼠 (新版命名) Android Studio...
Android Studio Electric Eel 2022.1.1 Canary 2(android-studio-2022.1.1.2-mac.zip) 适用于macOS Intel系统,文件使用WinRAR分割两个压缩包,必须一起下载使用。在macOS使用WinZip进行解压: Android Studio ...
Android Studio Dolphin (2021.3.1) Canary 3 (android-studio-2021.3.1.3-mac.zip)海豚 适用于macOS Intel芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: android-studio-2021.3.1.3-mac...
Android Studio Hedgehog 2023.1.1(android-studio-2023.1.1.4-windows.zip) 适用于Windows系统,文件使用WinRAR分割两个压缩包,必须一起下载使用。 Android Studio Hedgehog(android-studio-2023.1.1.4-...
Android Studio Dolphin (2021.3.1) Canary 2 (android-studio-2021.3.1.2-windows.zip)海豚 适用于Windows系统: Android Studio版本排序: Dolphin | 2021.3.1 Chipmunk | 2021.2.1 Bumblebee | 2021.1.1 Arctic...
Android Studio Hedgehog 2023.1.1 RC 1(android-studio-2023.1.1.23-mac.zip)适用于macOS Intel系统,文件使用WinRAR分割成两个压缩包,必须一起下载使用: android-studio-2023.1.1.23-mac.part1.rar ...
Android Studio Chipmunk (2021.2.1) Beta 2 (android-studio-2021.2.1.9-mac_arm)花栗鼠 适用于macOS Arm芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: android-studio-2021.2.1.9-mac_...
Android Studio Chipmunk (2021.2.1) Beta 3 (android-studio-2021.2.1.10-mac_arm.zip)花栗鼠 适用于macOS Arm芯片系统,文件分割成两个压缩包,必须一起解压使用: Android Studio Chipmunk (android-studio-...
Android Studio Chipmunk (2021.2.1) Beta 4 (android-studio-2021.2.1.11-windows.zip)花栗鼠 适用于Windows系统: Android Studio版本排序: Dolphin | 2021.3.1 Chipmunk | 2021.2.1 Bumblebee | 2021.1.1 ...
Android Studio Giraffe 2022.3.1(android-studio-2022.3.1.14-windows.zip) 适用于Windows系统,文件使用WinRAR分割两个压缩包,必须一起下载使用。 Android Studio Giraffe(android-studio-2022.3.1.14-...
Android Studio Chipmunk (2021.2.1) Beta 2 (android-studio-2021.2.1.9-mac)花栗鼠 适用于macOS Intel芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: android-studio-2021.2.1.9-mac....
替换sdk路径下/platforms/android-28/android.jar,能够解决在android studio 看源码部分类报红及能够正常编译项目。解决替换as后报错:Failed to transform file 'android.jar' to match attributes {artifactType=...
Android Studio Bumblebee 稳定版(android-studio-2021.1.1.20-windows.exe) 大黄蜂,适用于Windows x86_64系统,是Android Studio 4.3(Android Studio Arctic Fox 2020.3.1.26新版本命名)版本之后的新版本Android...