繁体   English   中英

Android本机C ++错误

[英]Android Native C++ Errors

我正在使用Almalence:打开相机存储库

签出截图

给出编译错误:

错误:(24、34)ImageConversionUtils.h:没有此类文件或目录的编译终止。

make.exe:*** [C:\\ Users \\ sagar_000 \\ Documents \\ OpenCamera-master \\ app \\ build \\ intermediates \\ ndk \\ debug \\ obj / local / arm64-v8a / objs / OpenCamera-master / C_ \\ Users \\ sagar_000 \\ Documents \\ OpenCamera-master \\ app \\ src \\ main \\ jni \\ bestshot \\ bestshot.o]错误1

错误:任务':app:compileDebugNdk'的执行失败。

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'command'C:\\ Users \\ sagar_000 \\ AppData \\ Local \\ Android \\ sdk \\ ndk-bundle \\ ndk-build.cmd ''以非零退出值2结束

您只需要将这些ndk属性添加到build.gradle中即可。 必须与defaultConfig处于同一级别

sourceSets.main {
    jni.srcDirs = [] // This prevents the auto generation of Android.mk
    jniLibs.srcDir 'src/main/libs' // This is not necessary unless you have precompiled libraries in your project.
}

task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = android.ndkDirectory
    commandLine "$ndkDir/ndk-build.cmd",
            '-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
            '-j', Runtime.runtime.availableProcessors(),
            'all',
            'NDK_DEBUG=1'
}

task cleanNative(type: Exec, description: 'Clean JNI object files') {
    def ndkDir = android.ndkDirectory
    commandLine "$ndkDir/ndk-build.cmd",
            '-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
            'clean'
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM