gpt4 book ai didi

java - 错误 : input directory 'Files' does not exist

转载 作者:太空狗 更新时间:2023-10-29 15:52:26 25 4
gpt4 key购买 nike

需要使用命令行从资源构建 R.java 文件。我使用以下 Java 程序执行此操作。我明白了

ERROR: input directory 'Files' does not exist

这是我的代码,任何人都可以帮助缺少哪个文件目录。或者为什么会弹出这个错误。

public static String ProjectPath = "C:\\Users\\Muzammil-Husnain\\testing\\Soothing-snow-fall";
public static String ANDROID_HOME = "C:\\\"Program Files (x86)\"\\Android\\android-sdk";

public static void generateRfile() {
try {
File projectDirectoryFile = new File(ProjectPath);
String command = "aapt package -v -f -m "+
" -S \""+projectDirectoryFile.getCanonicalPath()+"\\res\"" +
" -J \""+projectDirectoryFile.getCanonicalPath()+"\\gen\"" +
" -M \""+projectDirectoryFile.getCanonicalPath()+"\\AndroidManifest.xml\"" +
" -I C:\\\"Program Files (x86)\"\\Android\\android-sdk\\platforms\\android-21\\android.jar\"";
System.out.println("Directory Path : "+projectDirectoryFile.getCanonicalPath());
System.out.println(command);
ProcessBuilder processBuilder = new ProcessBuilder("cmd.exe", "/c", command);
processBuilder.redirectErrorStream(true);
Process process = processBuilder.start();
BufferedReader r = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while (true) {
line = r.readLine();
if (line == null) {
break;
}
System.out.println(line);
}

} catch (IOException ex) {
Logger.getLogger(RunApplicationOnPrject.class.getName()).log(Level.SEVERE, null, ex);
}
}

Here is The Directory

最佳答案

我发现错误

"-I C:\\\"Program Files (x86)\"\\Android\\android-sdk\\platforms\\android-21\\android.jar\"";

此行缺少 URL 的起始引号,但包含结尾引号我已修复错误通过包括这样的引用:

" -I \"C:\\\"Program Files (x86)\"\\Android\\android-sdk\\platforms\\android-21\\android.jar\""

感谢@Prashant 和@Laszlo Lugosi 的关注。

关于java - 错误 : input directory 'Files' does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28982040/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com