-
NDK编译错误
Execution failed for task ':libuvccamera:ndkClean'. > Process 'command 'D:\android-ndk-r22b-windows-x86_64\android-ndk-r22b/ndk-build.cmd'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
NDK版本过高,我这边使用r12版本,下载地址
https://github.com/android/ndk/wiki/Unsupported-Downloads
在local.properties文件后添加ndk.dir=D\:\\android-ndk-r12b-windows-x86_64\\android-ndk-r12b
-
libcommon库问题
Could not resolve all dependencies for configuration ':usbCameraTest:debugRuntimeClasspath'. Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven9(http://raw.github.com/saki4510t/libcommon/master/repository/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.4/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
直接删除下面引用,后面根据编译报错删除HandlerThreadHandler和BuildCheck相关API的调用,不影响后面使用
implementation ("com.serenegiant:common:${commonLibVersion}") { exclude module: 'support-v4' }
-
修改build.gradle文件
buildscript { repositories { // google() maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/google") } maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://jitpack.io") } maven { setUrl("https://maven.aliyun.com/nexus/content/groups/public/") } maven { setUrl("https://maven.aliyun.com/nexus/content/repositories/jcenter") } gradlePluginPortal() google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:4.2.2' } } allprojects { repositories { // google() maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/google") } maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://jitpack.io") } maven { setUrl("https://maven.aliyun.com/nexus/content/groups/public/") } maven { setUrl("https://maven.aliyun.com/nexus/content/repositories/jcenter") } gradlePluginPortal() google() mavenCentral() }
-
执行后生成libuvccamera\build\outputs\aar\libuvccamera-release.aar
Android使用UVCCamera打开USBCamera-编译
最新推荐文章于 2025-03-07 09:47:04 发布