有台机器系统是windows10+AndroidStudio3.4(3.2等都试过),C/C++代码无语法提示,不能debug,但是编译完全没问题。各种清除缓存restart都试过就是不行,就差重新安装了。同样的工程在其他好的机器是OK的。另外一台好的机器(MAC)是可以的,但是升级了下NDK后C、C++代码全部很多标红,但是可以debug。试过卸载ndk,重新下载指定ndk版本,各种清除缓存等也不行。

解决方案 »

  1.   

    我之前也这样,后来不知道怎么就有提示了会不会是sdk的原因
      

  2.   

    应该不是sdk的原因,该装的都装了。
      

  3.   

    把当前使用的sdk版本卸载在重装重启试试
    我碰到xml不提示的情况 就这样干的
      

  4.   

    你说的是ndk版本吧。android sdk 5 6 7 8 9 10我都装了,全部卸载重试?
      

  5.   

    不,就sdk你当前使用的sdk版本compileSdkVersion 是多少  就卸载哪一个 
    28 -> android 9
    等等
      

  6.   

    1.    defaultConfig {
            externalNativeBuild {
                cmake {
                    arguments '-DANDROID_STL=c++_static'
                    cppFlags "-std=c++14"
                }
            }
        }
    2.cmakelist
    # 设置include文件夹的地址
    include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/)
    set(CMAKE_VERBOSE_MAKEFILE on)aux_source_directory(. DIR_LIB_SRCS)
    aux_source_directory(./object_tracking OTHER_SRC_LIST)
    list(APPEND DIR_LIB_SRCS ${OTHER_SRC_LIST})
    # Creates and names a library, sets it as either STATIC
    # or SHARED, and provides the relative paths to its source code.
    # You can define multiple libraries, and CMake builds them for you.
    # Gradle automatically packages shared libraries with your APK.
    add_library( # Sets the name of the library.
            native-lib        # Sets the library as a shared library.
            SHARED        # Provides a relative path to your source file(s).            
            ${DIR_LIB_SRCS}
            )
      

  7.   

    我都是用其他软件来写的c++,然后编译成so后放入android再测试
      

  8.   

    试了旅行蜗牛,Krisez方法都不行是用VS吗?