saki4510t / UVCCamera

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

error when build on windows #16

Closed bitdust closed 9 years ago

bitdust commented 9 years ago

the build.gradle can't work well on windows.

task ndkBuild in your build.gradle could be better:

import org.apache.tools.ant.taskdefs.condition.Os
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()
    println(ndkDir)
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine "$ndkDir/ndk-build.cmd",
                'NDK_PROJECT_PATH=build',
                'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
                'NDK_APPLICATION_MK=src/main/jni/Application.mk',
                '-j8'
    }
    else {
        commandLine "$ndkDir/ndk-build",
                'NDK_PROJECT_PATH=build',
                'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
                'NDK_APPLICATION_MK=src/main/jni/Application.mk',
                '-j8'
    }
}

than:

task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()
    println(ndkDir)
    commandLine "$ndkDir/ndk-build",
            'NDK_PROJECT_PATH=build',
            'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
            'NDK_APPLICATION_MK=src/main/jni/Application.mk',
            '-j8'
}

Refer to:https://stackoverflow.com/questions/27477158/android-studio-ndk-build-trouble-errorexecution-failed-for-task-appbuildnati

Darksideneo commented 9 years ago

It works fine on Windows if you will correct paths in the right way. I can show how tomorrow. On Sep 20, 2015 00:09, "bitdust" notifications@github.com wrote:

the build.gradle https://github.com/saki4510t/UVCCamera/blob/master/libuvccamera/build.gradle can't work well on windows.

task ndkBuild in your build.gradle https://github.com/saki4510t/UVCCamera/blob/master/libuvccamera/build.gradle could be better:

import org.apache.tools.ant.taskdefs.condition.Os task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') { def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder() println(ndkDir) if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine "$ndkDir/ndk-build.cmd", 'NDK_PROJECT_PATH=build', 'APP_BUILD_SCRIPT=src/main/jni/Android.mk', 'NDK_APPLICATION_MK=src/main/jni/Application.mk', '-j8' } else { commandLine "$ndkDir/ndk-build", 'NDK_PROJECT_PATH=build', 'APP_BUILD_SCRIPT=src/main/jni/Android.mk', 'NDK_APPLICATION_MK=src/main/jni/Application.mk', '-j8' } }

than:

task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') { def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder() println(ndkDir) commandLine "$ndkDir/ndk-build", 'NDK_PROJECT_PATH=build', 'APP_BUILD_SCRIPT=src/main/jni/Android.mk', 'NDK_APPLICATION_MK=src/main/jni/Application.mk', '-j8' }

Refer to: https://stackoverflow.com/questions/27477158/android-studio-ndk-build-trouble-errorexecution-failed-for-task-appbuildnati

— Reply to this email directly or view it on GitHub https://github.com/saki4510t/UVCCamera/issues/16.

saki4510t commented 9 years ago

Hi, thank you for providing feedback.
I updated build.grade in libuvccamera.
saki