rmtheis / tess-two

Fork of Tesseract Tools for Android
Apache License 2.0
3.76k stars 1.38k forks source link

android studio2.1.2 not build #168

Closed sujiewen closed 8 years ago

sujiewen commented 8 years ago
// Call external ndk-build(.cmd) script to build the native code
task ndkBuild(type: Exec) {

// def ndkBuildExt = Os.isFamily(Os.FAMILY_WINDOWS) ? ".cmd" : "" // commandLine "ndk-build${ndkBuildExt}", '-C', file('src/main').absolutePath, // '-j', Runtime.runtime.availableProcessors() if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine "ndk-build.cmd", '-C', file('src/main').absolutePath, '-j', Runtime.runtime.availableProcessors() } else { commandLine "/Users/Sjw/Library/Android/sdk/ndk-bundle/ndk-build", '-C', file('src/main').absolutePath, '-j', Runtime.runtime.availableProcessors() } }

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

// Cleanup task to remove previously generated binaries
task ndkClean(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine "ndk-build.cmd", '-C', file('src/main').absolutePath, 'clean'
    }
    else {
        commandLine "/Users/Sjw/Library/Android/sdk/ndk-bundle/ndk-build", '-C', file('src/main').absolutePath, 'clean'
    }

// def ndkBuildExt = Os.isFamily(Os.FAMILY_WINDOWS) ? ".cmd" : "" // commandLine "ndk-build${ndkBuildExt}", '-C', file('src/main').absolutePath, 'clean' }

FAILURE: Build failed with an exception.

BUILD FAILED

rmtheis commented 8 years ago

@sujiewen Did you set the path to your NDK installation in the Project Structure dialog (File->Project Structure)?

sujiewen commented 8 years ago

@rmtheis Already set,See screenshot!Command line can compile。

2016-08-17 17 18 05
rmtheis commented 8 years ago

Be sure to add your NDK folder to your PATH. If that does not fix it, please open a new issue with the stack trace and the complete steps needed to reproduce this.

rmtheis commented 8 years ago

See also: http://stackoverflow.com/questions/33725630/why-is-android-studio-ignoring-my-bashrc-file-on-osx