80,349
社区成员
发帖
与我相关
我的任务
分享
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.cloud.bs.ffmpegtest01"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
ndk {
abiFilters "armeabi"
}
}
}
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:28.0.0'
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'
}
cmake_minimum_required(VERSION 3.4.1)
include_directories(
src/main/cpp/include
)
set(LIBS ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI})
add_library( # Sets the name of the library.
ffmpeg-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/ffmpeg-lib.cpp)
add_library(libavcodec-56 SHARED IMPORTED)
set_target_properties(libavcodec-56 ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavcodec-56.so)
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log )
target_link_libraries( # Specifies the target library.
ffmpeg-lib
# Links the target library to the log library
# included in the NDK.
# libavcodec-56
${log-lib})
Build command failed.
Error while executing process D:\Android\SDK\cmake\3.6.4111459\bin\cmake.exe with arguments {-HD:\Android\MyApplications\FFMpegTest01\app -BD:\Android\MyApplications\FFMpegTest01\app\.externalNativeBuild\cmake\debug\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Android\MyApplications\FFMpegTest01\app\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=D:\Android\SDK\android-ndk-r16b_x64 -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=D:\Android\SDK\android-ndk-r16b_x64\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=D:\Android\SDK\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
(include) CMakeLists.txt
(include) CMakeLists.txt
CMake Error at CMakeLists.txt:20 (set_target_properties):
-- Configuring incomplete, errors occurred!
*********************************Build信息********************************************
See also "D:/Android/MyApplications/FFMpegTest01/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeOutput.log".
Build command failed.
Error while executing process D:\Android\SDK\cmake\3.6.4111459\bin\cmake.exe with arguments {-HD:\Android\MyApplications\FFMpegTest01\app -BD:\Android\MyApplications\FFMpegTest01\app\.externalNativeBuild\cmake\release\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Android\MyApplications\FFMpegTest01\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=D:\Android\SDK\android-ndk-r16b_x64 -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=D:\Android\SDK\android-ndk-r16b_x64\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=D:\Android\SDK\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
(include) CMakeLists.txt
(include) CMakeLists.txt
CMake Error at CMakeLists.txt:20 (set_target_properties):
-- Configuring incomplete, errors occurred!
See also "D:/Android/MyApplications/FFMpegTest01/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeOutput.log".