使用RenderScript库进行编译时出错:llvm-rs-cc.exe''完成非零退出值-1073741515

时间:2015-10-13 16:59:36

标签: java android android-gradle renderscript

正如标题所提到的,当我想将RenderScript添加到我的项目中时,我收到以下错误(在Gradle Sync上):

错误:任务' :app:compileDebugRenderscript '执行失败。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令' C:\ Users \ Dries \ AppData \ Local \ Android \ sdk2 \ build-tools \ 23.0.1 ** LLVM-RS-cc.exe''完成非零退出值-1073741515 **

我使用的是Android Studio 1.3.2

这是我的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文件:

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文件:

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'
        }
    }
}

我对Stephen Hines的评论中提到的其他错误'交:

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!

2 个答案:

答案 0 :(得分:2)

这是SDK的打包问题。您可以将相关的.dll文件从工具安装的lib /部分复制到bin /目录中。它们应该是libClang.dll,libLLVM.dll和libbcc.dll。

答案 1 :(得分:0)

将tesstwo build.gradle文件替换为:

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=[]
        }
    }
}

重要:

确保使用gradle构建工具1.3。+