【问题标题】:Including a file at the root of a built APK在构建的 APK 的根目录中包含一个文件
【发布时间】:2018-10-24 19:15:30
【问题描述】:

我有一个 .properties 文件,我需要它位于已构建 APK 的根级别。

问题是文件以下划线开头时没有添加(例如_xyz.properties), 但没有下划线,它被添加到根。

例如:

If I place a properties file within my project, called xyz.properties

and I add that file as a resource by adding the following in build.gradle:

sourceSets {
    main {
        resources.srcDirs = ['src/main/java/xyzLocation']
    }
}

When I build and inspect the created APK, the xyz.properties file is present at the root.

If I rename the file to _xyz.properties and build an APK again

_xyz.properties is not present within the APK

【问题讨论】:

  • 欢迎来到 StackOverflow!请添加一些代码来显示您的努力并指出您卡在哪里

标签: android resources apk


【解决方案1】:

对于遇到此问题的其他人,这似乎是一个已知问题 (https://issuetracker.google.com/issues/36911326)。

注意,如果您将 Eclipse 与 ADT 一起使用,还有另一个问题是“aapt.ignore.assets”属性被忽略 (https://issuetracker.google.com/issues/36961705)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 2020-06-17
    • 2013-05-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多