android - 构建 CMake 时 Ninja 发生错误
问题描述
我在构建 CMake 时发生错误。
build.gradle 文件:
apply plugin: 'com.android.application' android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.ffmpeg"
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-frtti -fexceptions"
abiFilters 'arm64-v8a'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
}
}}dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'}
我的项目
项目结构
我该如何解决这个错误?
Build command failed.
Error while executing process D:\install\sdk\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C D:\Android projects\ffmpeg\app\.cxx\cmake\debug\arm64-v8a native-lib}
ninja: Entering directory `D:\Android projects\ffmpeg\app\.cxx\cmake\debug\arm64-v8a'
ninja: error: FindFirstFileExA(/d:/install/sdk/ndk/21.0.6113669/arm64-v8a): The filename, directory name, or volume label syntax is incorrect.
解决方案
从 build.gradle 文件中删除此代码并再次构建。它对我有用。
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
}
}
推荐阅读
- ansible - 为什么 Ansible win_regedit 不更改 Windows 注册表值?
- sql - SQL:跨平台生成N位唯一标识符(SQL Server、Snowflake等)
- jquery - Toastr onhidden function 只有成功消息
- css - for循环中的动态函数参数
- jira - 如何在jira云应用中获取公司名称
- python - 如何为现有熊猫数据框中的每个条目添加标志
- closures - 在 for 循环中使用 var 和使用闭包会产生不同的结果
- google-cloud-platform - 无法将 Search Ads 360 中的历史数据导入 Google BigQuery
- php - 序列化表单验证 Laravel 8
- uml - 如何从用例图中识别正确的主要参与者?