针对Alize说话人识别项目的android studio CMAKE问题出错

时间:2018-05-25 06:01:29

标签: android-studio cmake

我收到此错误 在EnableLanguage

之后未设置CMAKE_CXX_COMPILER

我正在尝试编译一个项目,android studio说它需要NDK然后CMAKE。它下载了两个并同步了项目,但是我收到了这个错误。

此错误已得到纠正但现在我还有其他错误

External Native Build Issues
    Build command failed.
    Error while executing process C:\Users\sriranjan\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\research\speaker recognition\android-alize-master\alize -BC:\research\speaker recognition\android-alize-master\alize\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\research\speaker recognition\android-alize-master\alize\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\sriranjan\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\sriranjan\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\sriranjan\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
    -- Check for working C compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
    -- Check for working C compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
    -- Check for working CXX compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    CMake Error at CMakeLists.txt:96 (add_library):
        src/main/cpp/alize-core/src/alizeString.cpp
      Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
      .hxx .in .txx
    CMake Error: CMake can not determine linker language for target: alize-native
    -- Generating done
    -- Build files have been written to: C:/research/speaker recognition/android-alize-master/alize/.externalNativeBuild/cmake/release/armeabi-v7a
    Build command failed.
    Error while executing process C:\Users\sriranjan\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\research\speaker recognition\android-alize-master\alize -BC:\research\speaker recognition\android-alize-master\alize\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\research\speaker recognition\android-alize-master\alize\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\sriranjan\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\sriranjan\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\sriranjan\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
    -- Check for working C compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
    -- Check for working C compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
    -- Check for working CXX compiler: C:/Users/sriranjan/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    CMake Error at CMakeLists.txt:96 (add_library):
        src/main/cpp/alize-core/src/alizeString.cpp
      Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
      .hxx .in .txx
    CMake Error: CMake can not determine linker language for target: alize-native
    -- Generating done
    -- Build files have been written to: C:/research/speaker recognition/android-alize-master/alize/.externalNativeBuild/cmake/debug/armeabi-v7a
C:\research\speaker recognition\android-alize-master\alize\build.gradle
    Warning:Warning:Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation' and 'androidTestApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    Warning:Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    Warning:Warning:Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    Warning:Warning:Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    Warning:Warning:Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

进一步的进展......提到从alize-core和LIA-RAL添加src文件夹的内容。 alize-core还有一个include文件夹。我也应该添加它们。 LIA-RAL在这些文件夹中有许多文件夹和许多src文件夹。所以我不确定如何将这些文件夹中的内容添加到cpp文件夹。

当我直接添加文件夹时,我遇到以下错误。

Error:FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':alize'. > executing external native build for cmake C:\research\speaker recognition\android-alize-master\alize\CMakeLists.txt * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

我不确定如何从主repo文件夹中添加所有这些文件夹的内容。

我收到此错误

CMake Error at CMakeLists.txt:96 (add_library):
    src/main/cpp/alize-core/src/alizeString.cpp
  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
CMake Error: CMake can not determine linker language for target: alize-native

最新错误是

Error:(2) error: attribute 'package' in <manifest> tag is not a valid Android package name: 'AlizeSpkRec'.
Error:org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

这是我的清单标签

manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="AlizeSpkRec"
    android:versionCode="1"
    android:versionName="1.0" >

因此,为了克服清单错误,我将包名称命名为com.android.AlizeSpkRec,但它只是写入AlizeSpkRec。 AndroidManifest.xml文件位于alize / build / intermediate / manifests / aapt / release和/ debug中。看起来每次我尝试构建项目时都会被重写。那么存储的实际包名称在哪里以及如何更改呢?

1 个答案:

答案 0 :(得分:0)

如评论中所述,所有错误都已解决。以下是成功编译项目的步骤。将与cmakelists.txt文件同名的alize-core和LIA-RAL文件夹添加到相应的cpp文件夹中。添加spro最新的库文件夹。

如果你得到spflag_t SPRO_flag错误,请将数据类型更改为int。仅使用spro 5.0最新包进行编译。

将包名称提及为com.android.AlizeSpkRec

然后事情应该有效。