作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一些偏好数据,不应该备份,因为它们在不同的设备上无效。
这些是我的Manifest.xml
和备份规则文件。
list .xml
<application
android:name=".WeNoteApplication"
android:backupAgent="com.yocto.wenote.auto_backup.CustomBackupAgent"
android:fullBackupOnly="true"
android:allowBackup="true"
android:fullBackupContent="@xml/my_backup_rules"
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="sharedpref" path="com.yocto.wenote_preferences.xml" />
<exclude domain="sharedpref" path="com.yocto.wenote.backup.Backuper.xml" />
</full-backup-content>
com.yocto.wenote.backup.Backuper.xml
is not in an included path
最佳答案
您收到此错误是因为您排除的路径超出了备份中包含的路径。如果您指定任何自定义 include
,那么只有那些东西会被备份:
<include>
- Specifies a file or folder to backup. By default, Auto Backup includes almost all app files. If you specify an element, the system no longer includes any files by default and backs up only the files specified. To include multiple files, use multiple elements.
exclude
在
com.yocto.wenote.backup.Backuper.xml
不在
include
路径
com.yocto.wenote_preferences.xml
- 因此错误。
!hasPrefix
。案子。
for (String includePath : included) {
if (excludePath.startsWith(includePath)) {
if (excludePath.equals(includePath)) {
Attr pathNode = exclude.getAttributeNode(ATTR_PATH);
assert pathNode != null;
Location location = context.getValueLocation(pathNode);
// Find corresponding include path so we can link to it in the
// chained location list
for (Element include : includes) {
Attr includePathNode = include.getAttributeNode(ATTR_PATH);
String includeDomain = include.getAttribute(ATTR_DOMAIN);
if (includePathNode != null
&& excludePath.equals(includePathNode.getValue())
&& domain.equals(includeDomain)) {
Location earlier = context.getLocation(includePathNode);
earlier.setMessage("Unnecessary/conflicting <include>");
location.setSecondary(earlier);
}
}
context.report(ISSUE, exclude, location,
String.format("Include `%1$s` is also excluded", excludePath));
}
hasPrefix = true;
break;
}
}
if (!hasPrefix) {
Attr pathNode = exclude.getAttributeNode(ATTR_PATH);
assert pathNode != null;
context.report(ISSUE, exclude, context.getValueLocation(pathNode),
String.format("`%1$s` is not in an included path", excludePath));
}
com.yocto.wenote_preferences.xml
包含在您的备份中。
adb shell setprop log.tag.GmsBackupTransport VERBOSE
adb shell setprop log.tag.BackupXmlParserLogging VERBOSE
关于android - 从完整备份中排除所选首选项文件的正确方法是什么?我收到 "is not in an included path"警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57911803/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!