应避免使用 flatDirs,因为它不支持任何元数据格式 [英] Using flatDirs should be avoided because it doesn't support any meta-data formats

查看:33
本文介绍了应避免使用 flatDirs,因为它不支持任何元数据格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android Studio 中构建时看到以下警告:

I'm seeing the following warning when building in Android Studio:

应避免使用 flatDirs,因为它不支持任何元数据格式

Using flatDirs should be avoided because it doesn't support any meta-data formats

我正在与本地打包在我的 libs 目录中的 aar 集成.是否有另一种方法可以在不将以下有问题的块添加到我的 build.gradle 中的情况下进行集成?

I'm integrating with an aar that is packaged locally in my libs directory. Is there another way to integrate without adding the following problematic block to my build.gradle?

repositories {
    flatDir {
        dirs 'libs'
    }
}

推荐答案

使用 LIBS 目录.删除该代码并将其替换为 module.gradle 中的以下内容.

Use the LIBS directory. Remove that code and replace it by the following in the module.gradle.

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

这篇关于应避免使用 flatDirs,因为它不支持任何元数据格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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