0

在构建我的应用程序时,我收到此错误:

Error:Execution failed for task ':app:transformClasses_enhancedWithInstant+reloadDexForDebug'.
java.io.IOException: Invalid incremental change record : CHANGED,C:\Users\gingo\Documents\Dropbox (SKOUMAL, s.r.o.)\work\myproject\MyProject\app\build\intermediates\transforms\instantRun\debug\folders\4000\5\enhanced\com\android\tools\fd\runtime\AppPatchesLoaderImpl.class

摆脱它的唯一方法是Build -> Rebuild project

4

1 回答 1

1

罪魁祸首是,项目路径中的(逗号)。只需将其删除即可。

让我稍微深入地解释一下。原因可以在ChangeRecords.java文件中找到。在方法load(File file)中,它从文件中解析一些更改记录,并使用,(逗号)作为行字段的分隔符。查看方法的完整代码:

/**
 * Load change records from a persisted file.
 */
@NonNull
static ChangeRecords load(File file) throws IOException {
    ChangeRecords changeRecords = new ChangeRecords();
    List<String> rawRecords = Files.readLines(file, Charsets.UTF_8);
    for (String rawRecord : rawRecords) {
        StringTokenizer st = new StringTokenizer(rawRecord, ",");
        if (st.countTokens() != 2) {
            throw new IOException("Invalid incremental change record : " + rawRecord);
        }
        changeRecords.add(Status.valueOf(st.nextToken()), st.nextToken());
    }
    return changeRecords;
}
于 2016-04-25T08:04:06.363 回答