添加pre建。所以采用了Android摇篮插件0.7.3在项目文件 [英] Add pre-built .so files in project using Android Gradle plugin 0.7.3

查看:131
本文介绍了添加pre建。所以采用了Android摇篮插件0.7.3在项目文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在那么长的时间来增加在Android项目的Andr​​oid摇篮0.7.3插件添​​加了pre建.so文件的支持。但是,不像我,很多人还在使用破解/解决方法增加pre-建.so文件,即使用压缩在一定层次重新命名的文件,然后到的.jar。下面是如何正确添加.so文件一步一步的指导。

Well after a long time the support to add pre-built .so files in an Android project has been added in Android Gradle plugin 0.7.3. But unlike me a lot of people are still using the hack/workaround to add pre-built .so files, i.e zip the files using a certain hierarchy and then re-name into a .jar. Below is a step by step guide to how to properly add .so files.

推荐答案

那么,如何您可以添加pre建.so文件?

So how you can add the pre-built .so files ?

1)升级你的机器人工作室0.4.0
2)在gradle-wrapper.properties替换distributionUrl =与distributionUrl = HTTP \://services.gradle.org/distributions/gradle-1.9-all.zip
3)添加/替换为你buildscript部分build.gradle:

1) Upgrade your android studio to 0.4.0
2) Replace "distributionUrl=" in gradle-wrapper.properties with "distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip"
3) Add/Replace your 'buildscript' section build.gradle with:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.3'
    }
} 

4)

4)

5)添加在您的build.gradle如下:

5) Add the following in your build.gradle:

android {
    compileSdkVersion 18
    buildToolsVersion "18.1.0"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 18
    }

    productFlavors {
        x86 {
            ndk {
                abiFilter "x86"
            }
        }
        arm {
            ndk {
                abiFilters "armeabi-v7a", "armeabi"
            }
        }

    }


    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/notice.txt'
    }
}    

6)生成项目。

6) Build your project.

这篇关于添加pre建。所以采用了Android摇篮插件0.7.3在项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆