• Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt


    Android Studio 右键Linking an external C++ project 时候

    报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的路径就不会出现这个错误.

  • 相关阅读:
    hadoop中map和reduce的数量设置问题
    Flink基础
    Leetcode中的SQL题目练习(二)
    Redis-2- 基本概念
    Redis-1-安装
    C#事件(1)
    java(13)内部类
    java(12)异常处理
    java(11)构造器
    java(10)接口抽象类
  • 原文地址:https://www.cnblogs.com/spring87/p/6007191.html
Copyright © 2020-2023  润新知