Я попытался импортировать образец Google Android в Android Studio. 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>
Задача ещё не решена.
Других решений пока нет …