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