简体   繁体   English

RSRuntimeException:加载ScriptC脚本失败(构建工具19.0.2)

[英]RSRuntimeException: Loading of ScriptC script failed (build tools 19.0.2)

Here's my entire output: 这是我的全部输出:

02-26 09:55:50.410      625-640/com.vsco.cam E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:299)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
            at java.util.concurrent.FutureTask.run(FutureTask.java:239)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: android.renderscript.RSRuntimeException: Loading of ScriptC script failed.
            at android.renderscript.ScriptC.<init>(ScriptC.java:61)
            at android.support.v8.renderscript.ScriptCThunker.<init>(ScriptCThunker.java:39)
            at android.support.v8.renderscript.ScriptC.<init>(ScriptC.java:62)
            at com.vsco.cam.utility.ScriptC_processing.<init>(ScriptC_processing.java:41)
            at com.vsco.cam.effects.EffectProcessor.initialize(EffectProcessor.java:67)
            at com.vsco.cam.LoadingAsyncTask.doInBackground(LoadingAsyncTask.java:24)
            at com.vsco.cam.LoadingAsyncTask.doInBackground(LoadingAsyncTask.java:16)
            at android.os.AsyncTask$2.call(AsyncTask.java:287)
            at java.util.concurrent.FutureTask.run(FutureTask.java:234)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
            at java.lang.Thread.run(Thread.java:841)

Here's a part of my build.gradle file: 这是我的build.gradle文件的一部分:

defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        renderscriptTargetApi 19
        renderscriptSupportMode=true
    } 

Prior to updating my build tools to 19.0.2, I was getting an rs for each error, which was fixed with the newest build tools version ( https://code.google.com/p/android/issues/detail?id=64110 ). 在将构建工具更新到19.0.2之前,我会针对每个错误获取rs,最新的构建工具版本( https://code.google.com/p/android/issues/detail?id= 64110 )。 Now I'm completely at a loss as to why this won't run on non-4.4 phones (phones that need backwards compat., aka, the support library). 现在我完全不知道为什么它不能在非4.4手机(需要向后兼容的手机,也就是支持库)上运行。 Is this the same issue as the rs for each, or am I just missing something? 这是与每个rs一样的问题,还是我只是想念一些东西?

Seems to be failing right here, within the ScriptC.java file: 似乎在此处失败,在ScriptC.java文件中:

protected ScriptC(RenderScript rs, Resources resources, int resourceID) {
        super(0, rs);
        int id = internalCreate(rs, resources, resourceID);
        if (id == 0) {
            throw new RSRuntimeException("Loading of ScriptC script failed.");
        }
        setID(id);
    }

ScriptC_processing: 41: ScriptC_processing:41:

 public  ScriptC_processing(RenderScript rs, Resources resources, int id) {
        super(rs, resources, id);
        __ALLOCATION = Element.ALLOCATION(rs);
        __SCRIPT = Element.SCRIPT(rs);
        __U32_2 = Element.U32_2(rs);
        __SAMPLER = Element.SAMPLER(rs);
        __F32_2 = Element.F32_2(rs);
        __I32 = Element.I32(rs);
        __F32 = Element.F32(rs);
        __U8_4 = Element.U8_4(rs);
    }

Edit: Looks like the id is being set here: 编辑:似乎在这里设置了id:

protected ScriptC(RenderScript rs, Resources resources, int resourceID) {
    super(0, rs);

    if (rs.isNative) {
        RenderScriptThunker rst = (RenderScriptThunker)rs;
        ScriptCThunker s = new ScriptCThunker(rst, resources, resourceID);
        mT = s;
        return;
    }

    int id = internalCreate(rs, resources, resourceID);
    if (id == 0) {
        throw new RSRuntimeException("Loading of ScriptC script failed.");
    }
    setID(id);
}

多亏了斯蒂芬·海因斯(Stephen Hines)的评论,这才得以中断是因为我的目标api被设置为19。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM