久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android - 渲染腳本支持庫 - 加載 RS jni 庫時出錯

Android - Renderscript Support Library - Error loading RS jni library(Android - 渲染腳本支持庫 - 加載 RS jni 庫時出錯)
本文介紹了Android - 渲染腳本支持庫 - 加載 RS jni 庫時出錯的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試將 Renderscript 支持庫包含到我的項(xiàng)目中.我收到以下錯誤.

I am trying to include the Renderscript support library into my project. I am getting the following error.

android.support.v8.renderscript.RSRuntimeException: Error loading RS jni library: java.lang.UnsatisfiedLinkError: Couldn't load rsjni: findLibrary returned null

我沒有使用任何 Renderscript jar 文件,我正在嘗試通過 Gradle 使用它.

I am not using any Renderscript jar files, I am attempting to use it via Gradle.

這是我的 Gradle.build 文件

Here are my Gradle.build files

頂級

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'
}
}

ext {
compileSdkVersion="Google Inc.:Google APIs:22"
buildToolsVersion="23.0.1"
playStoreMinSdkVersion=16
amazonStoreMinSdkVersion=8
targetSdkVersion=22
versionCode=20
versionName="3.3.0"
runProguard=true
zipAlign=true
proguardConfiguration='../proguard.config'
}

allprojects {
repositories {
    jcenter()
}
}

特定應(yīng)用

defaultConfig {
    applicationId "**REMOVED**"
    //noinspection GroovyAssignabilityCheck
    targetSdkVersion rootProject.ext.targetSdkVersion
    //noinspection GroovyAssignabilityCheck
    versionCode rootProject.ext.versionCode
    //noinspection GroovyAssignabilityCheck
    versionName rootProject.ext.versionName

    renderscriptTargetApi 23
    renderscriptSupportModeEnabled true
}

我嘗試的一切&在 stackoverflow 上找到可能的解決方案不起作用.我的 proguard 配置中也包含了這個

Everything I try & find as possible solutions on stackoverflow are not working. I also have this included in my proguard config

#RenderScript
-keepclasseswithmembernames class * {
native <methods>;
}
-keep class android.support.v8.renderscript.** { *; }

這是我實(shí)際使用渲染腳本的實(shí)現(xiàn),這也是它在調(diào)用時導(dǎo)致我的應(yīng)用程序崩潰的地方.

Here is the implementation where I actually use renderscript, also this is where it causes my app the crash when called.

public static BitmapDrawable Blur ( View view ){

    Bitmap image = GetScreenshot( view );

    int width = Math.round( image.getWidth() * DEFAULT_BITMAP_SCALE );
    int height = Math.round( image.getHeight() * DEFAULT_BITMAP_SCALE );

    Bitmap inputBitmap = Bitmap.createScaledBitmap( image, width, height, false );

    Bitmap outputBitmap = Bitmap.createBitmap( inputBitmap );

    RenderScript rs = RenderScript.create( view.getContext() );
    ScriptIntrinsicBlur intrinsicBlur = ScriptIntrinsicBlur.create( rs, Element.U8_4(rs) );

    Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
    Allocation tmpOut = Allocation.createFromBitmap( rs, outputBitmap );

    intrinsicBlur.setRadius( DEFAULT_BLUR_RADIUS );
    intrinsicBlur.setInput( tmpIn );
    intrinsicBlur.forEach( tmpOut );

    tmpOut.copyTo( outputBitmap );

    inputBitmap.recycle();
    rs.destroy();

    return new BitmapDrawable( outputBitmap );
}

這是確切的行

RenderScript rs = RenderScript.create( view.getContext() );

推薦答案

很遺憾,Renderscript 不適用于 armeabi 架構(gòu).好的一面是您可以在運(yùn)行時檢查設(shè)備的架構(gòu),而不是在這些設(shè)備上運(yùn)行 Renderscript 代碼:

Unfortunately Renderscript is not available for the armeabi architecture. The bright side is that you can check at runtime to see the architecture of the device and not run the Renderscript code on those devices:

System.getProperty("os.arch");

在 android 錯誤跟蹤器上還存在一個問題,他們指出:

There is also an issue open on the android bug tracker, where they state:

我們僅提供 armeabi-v7a 的支持庫.這是一個已知的限制.

We only ship the support library for armeabi-v7a. This is a known limitation.

https://code.google.com/p/android/issues/detail?id=68520

如果您想在 armeabi 設(shè)備上實(shí)現(xiàn)沒有 Renderscript 的模糊,您可以簡單地使用 Bitmap.createScaledBitmap 設(shè)置 filtertrue.

If you want to implement a blur without Renderscript on armeabi devices, you can simply downscale the image with Bitmap.createScaledBitmap setting filter to true.

這篇關(guān)于Android - 渲染腳本支持庫 - 加載 RS jni 庫時出錯的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運(yùn)行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 日韩亚洲欧美在线观看 | www在线播放 | 国内自拍xxxx18| 免费在线观看av | 91福利网| 天天躁日日躁狠狠躁伊人 | 毛片网站视频 | 一级黄色片免费看 | 成 人 黄 色 片 在线播放 | 欧美日韩一区二区在线 | 免费av网址在线观看 | 狠狠操狠狠操 | 国产超碰在线 | 免费一级大片 | 成人毛片在线播放 | 在线观看日韩av | 国产中文字幕视频 | 免费成年人视频 | 国产三级在线观看视频 | 欧美亚洲在线 | 三级福利视频 | 久久三级视频 | 免费看成人片 | 艳妇臀荡乳欲伦交换h漫 | 成人在线免费网站 | 亚洲午夜18毛片在线看 | 深夜福利影院 | 午夜精品久久久久久久久久久久 | 少妇福利视频 | 国产91清纯白嫩初高中在线观看 | 国产午夜精品久久 | 日本黄色一级视频 | 久久久久久久国产 | 久久免费小视频 | 成人免费网站黄 | 日日日操 | 亚洲深夜福利 | 亚洲精品一区二区在线观看 | 午夜看片 | 国产精品911| 久久精品欧美一区 |