未知警告选项'-Wshadow字段';在android studio上使用双簧管时出错

未知警告选项'-Wshadow字段';在android studio上使用双簧管时出错,android,android-studio,android-ndk,c++14,oboe,Android,Android Studio,Android Ndk,C++14,Oboe,我已经使用android studio创建了一个ndk项目,每个想法都很好,我可以在emulator上毫无问题地启动我的应用程序。但当我将双簧管库添加到我的项目中时,当我尝试启动或构建我的应用程序时,会出现此错误。 我正在为这个应用程序使用c++14。 我觉得叮当声有点问题,但我不知道怎么解决 以下是错误日志、Cmake文件和build.gradle文件: 错误日志: Information:Gradle tasks [:app:assembleDebug] Error:unknown warn

我已经使用android studio创建了一个ndk项目,每个想法都很好,我可以在emulator上毫无问题地启动我的应用程序。但当我将双簧管库添加到我的项目中时,当我尝试启动或构建我的应用程序时,会出现此错误。 我正在为这个应用程序使用c++14。 我觉得叮当声有点问题,但我不知道怎么解决

以下是错误日志、Cmake文件和build.gradle文件:

错误日志:

Information:Gradle tasks [:app:assembleDebug]
Error:unknown warning option '-Wshadow-field' [-Werror,-Wunknown-warning-option]
Error:unknown warning option '-Wshadow-field' [-Werror,-Wunknown-warn
Error:unknown warning option '-Wshadow-field' [-Werror,-Wunknown-warning-option]
Information:BUILD FAILED in 1s
Information:3 errors
Information:0 warnings
Information:See complete output in console
CMakeLists.txt:

cmake_minimum_required(VERSION 3.4.1)
add_library( 
             native-lib
             SHARED
             src/main/cpp/native-lib.cpp )

find_library( 
              log-lib

              log )

target_link_libraries(
                       native-lib

                       ${log-lib} )

#set the path to the oboe directory
set (OBOE_DIR /home/user/AndroidProjects/oboe)

#add the Oboe library as a subdirectory in project
add_subdirectory (${OBOE_DIR} ./oboe)

#Specify the path to the Oboe header files
include_directories (${OBOE_DIR}/include)

#Specify the libraries which are native library is dependent on, including Oboe
target_link_libraries (native-lib log oboe)
build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.app.audiovisualizera"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++14"
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

谢谢

谢谢你@Michael。问题来自NDK版本。但是如果有人面临这个问题,一定要有最新的andriod studio版本和最新的gradle版本。因为它是必需的。

您正在使用哪个NDK版本?双簧管据说与NDK r17及更高版本配合使用
-Werror
由Oboe在调试版本中设置。作为一种解决方法,您可以从
CMakeLists.txt
中删除
-Wshadow字段