1

i have previous code in eclipse-NDK and it is in running successfully in eclipse i need to import this project into android studio and run ,but it is now showing a run-time error (unfortunately force close) error why is it happened if it is clean code need a help urgently.my build file is :buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.12.+' } } apply plugin: 'android'

dependencies { compile fileTree(dir: 'libs', include: '*.jar') }

android { compileSdkVersion 19 buildToolsVersion "20.0.0"

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 19
    ndk{
        moduleName "filters"
        abiFilter "armeabi-v7a"
        stl "gnustl_static"
    }
}
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }
    sourceSets.main {
        jni.srcDirs = []
        jniLibs.srcDir 'src/main/libs'
    }
    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}

}

  • Any issues with command line running gradle tasks? – Eugen Martynov Nov 04 '14 at 12:20
  • when i run command from terminal then it is not working and shows error my command is look like: app>cd main > javah -d jni -classpath path to android.jar;../../build/intermediates/classes/debug jniclassname (enter) it need to be create a folder jni and inside this it has to be .h file but it is not working instead shows error : debug - is a directory ??? – Amit Singh Tomar Nov 04 '14 at 12:55
  • http://stackoverflow.com/questions/21096819/jni-and-gradle-in-android-studio/21111458#21111458 http://ph0b.com/android-studio-gradle-and-ndk-integration/ – Robert Rowntree Nov 04 '14 at 15:19
  • i already followed this link http://ph0b.com/android-studio-gradle-and-ndk-integration/ but it is also not working shows can't load library error – Amit Singh Tomar Nov 05 '14 at 09:25

0 Answers0