saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.96k stars 1.19k forks source link

Execution failed for task ':libuvc:ndkBuild'. #706

Open MrAdi149 opened 1 week ago

MrAdi149 commented 1 week ago

i tried your Android Usb Camera project but i got erron on ndkBuild, please help me to solve the issue

my local.properties file look like this:

sdk.dir=C\:\Users\EXT.USER\AppData\Local\Android\Sdk

ndk.dir=C\:\Users\EXT.USER\AppData\Local\Android\Sdk\ndk\27.0.11902837

my build.gradle(:libuvc) look like this:

apply plugin: 'com.android.library'

import org.apache.tools.ant.taskdefs.condition.Os

android { namespace = "com.jiangdg.uvccamera" buildToolsVersion = "34.0.0" compileSdk = 35

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

defaultConfig {
    minSdk = 24
    targetSdk = 34
}

lintOptions {
    checkReleaseBuilds false
    abortOnError false
    disable 'MissingTranslation'
}

ndkVersion '27.0.11902837'

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

}

tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn ndkBuild }

String getNdkBuildPath() { Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) def ndkBuildingDir = properties.getProperty("ndk.dir") def ndkBuildPath = ndkBuildingDir if (Os.isFamily(Os.FAMILY_WINDOWS)) { ndkBuildPath = ndkBuildingDir + '/ndk-build.cmd' } else { ndkBuildPath = ndkBuildingDir + '/ndk-build' } return ndkBuildPath }

task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') { println('executing ndkBuild') def ndkBuildPath = getNdkBuildPath(); commandLine ndkBuildPath, '-j8', '-C', file('src/main').absolutePath }

task ndkClean(type: Exec, description: 'clean JNI libraries') { println('executing ndkBuild clean') def ndkBuildPath = getNdkBuildPath(); commandLine ndkBuildPath, 'clean', '-C', file('src/main').absolutePath }

clean.dependsOn 'ndkClean'

dependencies { implementation fileTree(dir: new File(buildDir, 'libs'), include: '*.jar') implementation "androidx.appcompat:appcompat:1.7.0" implementation 'com.elvishew:xlog:1.11.0' // implementation project(path: ':libuvccommon') }

now i am getting error like this:

Execution failed for task ':libuvc:ndkBuild'.

A problem occurred starting process 'command 'null/ndk-build.cmd''

Clark-caipeiyuan commented 1 week ago

收到了,谢谢!

MrAdi149 commented 1 week ago

请帮我解决这个问题,这真的很重要