Getting an error when compiling with RenderScript library: llvm-rs-cc.exe'' finished with non-zero exit value -1073741515

落爺英雄遲暮 提交于 2019-12-10 23:33:25

问题


As the title mentions, when I want to add RenderScript to my project, I get the following error (on Gradle Sync):

Error:Execution failed for task ':app:compileDebugRenderscript'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Dries\AppData\Local\Android\sdk2\build-tools\23.0.1**llvm-rs-cc.exe'' finished with non-zero exit value -1073741515**

I'm using Android Studio 1.3.2

This is my build.gradle:

    import com.android.build.gradle.internal.dsl.ProductFlavor

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.dries.myocrtest"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

        renderscriptTargetApi 22
        renderscriptSupportModeEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile project(':tesstwo')
    compile project(':fileExplorer')
}

tesstwo build.gradle file:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 20
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    sourceSets{
        main{
            jni.srcDirs=[]
        }
    }
}

fileExplorer build.gradle file:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
    }

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

Additional errors referred to in my comment on Stephen Hines' post:

warning: Linking two modules of different data layouts: 'C:\Users\Dries\AppData\Local\Android\sdk2\build-tools\23.0.1\renderscript\lib\bc\armeabi-v7a\libclcore.bc' is 'e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64' whereas 'C:\Users\Dries\AndroidDev\MyOCRTEST\app\build\generated\res\rs\debug\raw\bc64\inverse.bc' is 'e-m:e-i64:64-i128:128-n32:64-S128'
warning: Linking two modules of different target triples: C:\Users\Dries\AppData\Local\Android\sdk2\build-tools\23.0.1\renderscript\lib\bc\armeabi-v7a\libclcore.bc' is 'armv7-none-linux-gnueabi' whereas 'C:\Users\Dries\AndroidDev\MyOCRTEST\app\build\generated\res\rs\debug\raw\bc64\inverse.bc' is 'aarch64-none-linux-gnueabi'
E/bcc     (27612): Unable to compile the source to file C:\Users\Dries\AndroidDev\MyOCRTEST\app\build\intermediates\rs\debug\obj\armeabi-v7a\inverse.o! (Error loading input bitcode)
Error:Execution failed for task ':app:compileDebugRenderscript'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Dries\AppData\Local\Android\sdk2\build-tools\23.0.1\bcc_compat.exe'' finished with non-zero exit value 1
Failed to compile script!

回答1:


This is a packaging problem with the SDK. You could copy the relevant .dll files from the lib/ part of your tools installation into the bin/ directory. They should be libClang.dll, libLLVM.dll, and libbcc.dll.




回答2:


Replace tesstwo build.gradle file with:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 23
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    sourceSets{
        main{
            jni.srcDirs=[]
        }
    }
}

Important:

Make sure to use gradle build tools 1.3.+



来源:https://stackoverflow.com/questions/33108452/getting-an-error-when-compiling-with-renderscript-library-llvm-rs-cc-exe-fini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!