在Android Studio中导入Google示例“AAudios”的问题

时间:2018-01-17 13:23:13

标签: android c++ audio android-ndk sample

我尝试在Android Studio中导入Google Android示例。 AAudios(googlesamples / android-audio-high-performance)。如果需要低延迟,这是一个如何使用本机音频支持的示例。

Gradle sync给了我一些我不知道如何处理的错误。

我正在使用Android Studio 3.0.1,API26,NDK 16。

我该如何解决这个问题?

External Native Build Issues
Build command failed.
Error while executing process I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\cmake.exe with arguments {-HI:\Android\workspaceAndroidStudio\AAudios\echo\src\main\cpp -BI:\Android\workspaceAndroidStudio\AAudios\echo\.externalNativeBuild\cmake\debug\armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=I:\Android\sdk_androidStudio\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=I:\Android\workspaceAndroidStudio\AAudios\echo\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=I:\Android\sdk_androidStudio\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-26 -DANDROID_STL=c++_shared -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-26}
-- Check for working C compiler: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: I:/Android/sdk_androidStudio/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: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- Check for working CXX compiler: I:/Android/sdk_androidStudio/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:26 (add_library):
    ../../../../../debug-utils/trace.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: echo
-- Generating done
-- Build files have been written to: I:/Android/workspaceAndroidStudio/AAudios/echo/.externalNativeBuild/cmake/debug/armeabi-v7a
Build command failed.
Error while executing process I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\cmake.exe with arguments {-HI:\Android\workspaceAndroidStudio\AAudios\echo\src\main\cpp -BI:\Android\workspaceAndroidStudio\AAudios\echo\.externalNativeBuild\cmake\release\armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=I:\Android\sdk_androidStudio\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=I:\Android\workspaceAndroidStudio\AAudios\echo\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=I:\Android\sdk_androidStudio\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-26 -DANDROID_STL=c++_shared -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-26}
-- Check for working C compiler: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: I:/Android/sdk_androidStudio/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: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- Check for working CXX compiler: I:/Android/sdk_androidStudio/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:26 (add_library):
    ../../../../../debug-utils/trace.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: echo
-- Generating done
-- Build files have been written to: I:/Android/workspaceAndroidStudio/AAudios/echo/.externalNativeBuild/cmake/release/armeabi-v7a
Build command failed.
Error while executing process I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\cmake.exe with arguments {-HI:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\src\main\cpp -BI:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\.externalNativeBuild\cmake\release\armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=I:\Android\sdk_androidStudio\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=I:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=I:\Android\sdk_androidStudio\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-26 -DANDROID_STL=c++_shared -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-26}
-- Check for working C compiler: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: I:/Android/sdk_androidStudio/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: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- Check for working CXX compiler: I:/Android/sdk_androidStudio/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:29 (add_library):
    ../../../../../debug-utils/trace.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: hello-aaudio
-- Generating done
-- Build files have been written to: I:/Android/workspaceAndroidStudio/AAudios/hello-aaudio/.externalNativeBuild/cmake/release/armeabi-v7a
Build command failed.
Error while executing process I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\cmake.exe with arguments {-HI:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\src\main\cpp -BI:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\.externalNativeBuild\cmake\debug\armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=I:\Android\sdk_androidStudio\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=I:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=I:\Android\sdk_androidStudio\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=I:\Android\sdk_androidStudio\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-26 -DANDROID_STL=c++_shared -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-26}
-- Check for working C compiler: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: I:/Android/sdk_androidStudio/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: I:/Android/sdk_androidStudio/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- Check for working CXX compiler: I:/Android/sdk_androidStudio/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:29 (add_library):
    ../../../../../debug-utils/trace.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: hello-aaudio
-- Generating done
-- Build files have been written to: I:/Android/workspaceAndroidStudio/AAudios/hello-aaudio/.externalNativeBuild/cmake/debug/armeabi-v7a
I:\Android\sdk_androidStudio\ndk-bundle\build\cmake\android.toolchain.cmake
Warning:(63, 98)  (include)   CMakeLists.txt 
Warning:(63, 98)  (include)   CMakeLists.txt 
Warning:(63, 98)  (include)   CMakeLists.txt 
Warning:(63, 98)  (include)   CMakeLists.txt 
I:\Android\workspaceAndroidStudio\AAudios\echo\build.gradle
Error:Failed to resolve: project :audio-device
<a href="openFile:I:/Android/workspaceAndroidStudio/AAudios/echo/build.gradle">Open File</a>
I:\Android\workspaceAndroidStudio\AAudios\hello-aaudio\build.gradle
Error:Failed to resolve: project :audio-device
<a href="openFile:I:/Android/workspaceAndroidStudio/AAudios/hello-aaudio/build.gradle">Open File</a>

0 个答案:

没有答案