1

I'm developing an application for android in the image processing area. Thus, I need high performance. Part of the code is written in NDK and elsewhere in Renderscript. However, I can not compile the application due to ScriptC_ files are not being generated.

My rs files are in the folder ... \ app \ src \ main \ rs

And the raw folder was created in the \ res

Follow the gradle file (app):

apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 22
        buildToolsVersion = "22.0.1"

        defaultConfig.with {
            applicationId = "com.google.sample.helloandroidjni"
            minSdkVersion.apiLevel = 18
            targetSdkVersion.apiLevel = 23
            versionCode = 1
            versionName = "1.0"

            //habilita o renderscript no projeto
            renderscriptTargetApi = 18
            renderscriptSupportModeEnabled = true
        }

    }

    android.buildTypes {
        release {
            minifyEnabled = false
            proguardFiles.add(file('proguard-android.txt'))
        }
    }

//     ldLibs = ["android", "jnigraphics", <other ndk libraries you might need>] --> Compila as classe necessarias no codigo c
    android.ndk {
        moduleName = "ibmphotophun"
        ldLibs.addAll(["android", "EGL", "GLESv2", "dl", "log", "z", "jnigraphics"]) //adicao de bibliotecas nativas em c do NDK android
        debuggable = true
    }

    android.productFlavors {
        create("arm") {
            ndk.abiFilters.add("armeabi")
        }
        create("arm7") {
            ndk.abiFilters.add("armeabi-v7a")
        }
        create("arm8") {
            ndk.abiFilters.add("arm64-v8a")
        }
        create("x86") {
            ndk.abiFilters.add("x86")
        }
        create("x86-64") {
            ndk.abiFilters.add("x86_64")
        }
        create("mips") {
            ndk.abiFilters.add("mips")
        }
        create("mips-64") {
            ndk.abiFilters.add("mips64")
        }
        create("all")
    }
}

//repositories {
//    maven {
//        url 'https://raw.github.com/vRallev/mvn-repo/master/'
//    }
//}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:support-v4:22.2.0'
    compile files('libs/droidText.0.4.jar')
    compile files('libs/brimage.jar')
}

1 Answers1

1

Try to rename "rs" folder to "renderscript". It looks like gradle-experimental uses this folder for renderscript code. Helped me to solve this issue with gradle-experimental:0.7.0-beta1

Dmitry Gavrilko
  • 2,764
  • 1
  • 10
  • 5
  • Better state why the change helps the question. – fluter Apr 14 '16 at 07:21
  • Thank you so much. I made the following operations and worked for me, rename the "rs" folder to "renderscript", commented the statement (renderscriptTargetApi = 18) and changed the minSdkVersion to 19. – Anderson Brilhador Apr 14 '16 at 16:29