Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt
2016-10-28 11:53
459 查看
Android Studio 右键Linking an external C++ project 时候
报Invalid file name. Expected: CMakeLists.txt错误
查看Android Studio 源码:
发现是选择条目必须是BuildSystem.CMAKE,也就是必须选择路径,如果直接复制粘贴的路径,就会提示错误。
解决方案:
一步步选择CmakeLists.txt路径即可,不要直接粘贴CmakeLists.txt的路径就不会出现这个错误.
报Invalid file name. Expected: CMakeLists.txt错误
查看Android Studio 源码:
@Nullable private String validateProjectFilePath(@NotNull File file) { if (!file.exists()) { return "The selected file does not exist"; } if (myBuildSystemCombo.getSelectedItem() == BuildSystem.CMAKE && !file.getName().equals("CMakeLists.txt")) { return "Invalid file name. Expected: CMakeLists.txt"; } else if (myBuildSystemCombo.getSelectedItem() == BuildSystem.NDK_BUILD && !FileUtilRt.extensionEquals(file.getPath(), "mk")) { return "Invalid file extension. Expected: .mk"; } return null; }
发现是选择条目必须是BuildSystem.CMAKE,也就是必须选择路径,如果直接复制粘贴的路径,就会提示错误。
解决方案:
一步步选择CmakeLists.txt路径即可,不要直接粘贴CmakeLists.txt的路径就不会出现这个错误.
相关文章推荐
- How to use an external dll file in VisualStudio project
- AndroidStudio之NDK开发CMake CMakeLists.txt编写入门
- Android Studio CMakeLists.txt文件配置
- How to use an external dll file in VisualStudio project
- android in practice_Using external storage(FileExplorer project)
- Android异常总结---res\layout\addUser.xml: Invalid file name: must contain only [a-z
- An invalid form control with name='file[]' is not focusable.间接点击form表单的<input type="file">出现的问题
- Windows下Android Studio长时间停留在Building "Project Name" Gradle project info画面的解决方法
- CMake Error at CMakeLists.txt:14 (INCLUDE_FOR_PROJECT): Unknown CMake command"INCLUDE_FOR_PROJECT"
- Android异常总结---res\layout\addUser.xml: Invalid file name: must contain only [a-z
- android报错res\drawable-xhdpi\ic_Dianhua.png: Invalid file name: must contain only [a-z0-9_.]
- Android studio invalid project JDK解决方法
- (4.5.1.2)Open an existing Android Studio project和Import Non-Android Studio project图解
- Cmake知识----编写CMakeLists.txt文件编译C/C++程序
- .xml: Invalid file name: must contain only [a-z0-9_.]R文件不更新Android
- 【Android入门常见问题Part2】xxx.xml: Invalid file name: must contain only [a-z0-9_.]
- "name.bat" is not a recognized as an internal or external command,operable program or batch file
- Android异常总结---res\layout\addUser.xml: Invalid file name: must contain only [a-z
- 为c++调用matlab引擎编写CMakeLists.txt
- Invalid file name: must contain only [a-z0-9_.]【Android报错】