zoukankan      html  css  js  c++  java
  • Gradle 载入中 Android 下一个.so档

    1.在project下新建 jni/libs  目录   。 jni 是和原来的libs  同级 ,将全部的.so文件放入 新建的libs文件下


    2.在build.gradle 文件里新增下面内容到android{ } 下

      task copyNativeLibs(type: Copy) {

            from(new File(project(':HealthCare').getProjectDir(), 'libs')) { include '**/*.so' }
            into new File(buildDir, 'native-libs')
        }



        tasks.withType(Compile) {
            compileTask -> compileTask.dependsOn copyNativeLibs
        }


        clean.dependsOn 'cleanCopyNativeLibs'


        tasks.withType(com.android.build.gradle.tasks.PackageApplication) {
            pkgTask ->
                pkgTask.jniFolders = new HashSet<File>()
                pkgTask.jniFolders.add(new File(buildDir, 'native-libs'))

        }


    ******************************************

    很多其它交流就在Q群 107584987

    Coding Your Life

    ******************************************


    版权声明:本文博主原创文章,博客,未经同意不得转载。

  • 相关阅读:
    The Sixth Assignment
    The fifth assigiment
    网络编程
    面向对象
    python数据类型之集合
    python数据类型之列表
    python数据类型之字符串
    python数据类型之字典
    python数据类型之元组
    常用模块
  • 原文地址:https://www.cnblogs.com/lcchuguo/p/4804019.html
Copyright © 2011-2022 走看看