gpt4 book ai didi

android.renderscript.RSRuntimeException fatal error 4097

转载 作者:行者123 更新时间:2023-12-04 11:25:40 25 4
gpt4 key购买 nike

我从 android 上的 renderscript 得到以下崩溃:
enter image description here
100% 的崩溃发生在 android 11 上,96% 的崩溃发生在三星设备上。我删除了渲染脚本的所有实例,但这种崩溃仍在发生,所以它可能在我的依赖项之一中。
我找到了 got android.renderscript.RSRuntimeException on note4它说 4097 意味着致命的驱动程序错误,但没有提供有关如何修复它的任何详细信息。
有谁知道我该如何解决这个崩溃?
更新:当我在我的应用程序中搜索“renderscript”时,除非我把它放在范围内然后有一堆对它的引用,否则什么都没有出现。我不明白他们来自哪里
enter image description here
更新:需要明确的是,我已经从我的应用程序中删除了对渲染脚本的所有引用,但似乎我的一个或多个依赖项仍在使用它。我需要帮助隔离这些依赖项。一个叫做 android-30 的东西正在使用渲染脚本。这是 api 30 库还是什么?然后称为 support/v8 的东西正在使用渲染脚本。这是支持库吗? (我确实启用了支持库)
enter image description here
enter image description here

最佳答案

Migrate from RenderScript

RenderScript APIs are deprecated starting in Android 12. They willcontinue to function, but we expect that device and componentmanufacturers will stop providing hardware acceleration support overtime.


这似乎是供应商问题(驱动程序问题)
fatal error 4097: RS_ERROR_FATAL_UNKNOWN = 0x1000
static class MessageThread extends Thread {
RenderScript mRS;
boolean mRun = true;
int[] mAuxData = new int[2];

static final int RS_MESSAGE_TO_CLIENT_NONE = 0;
static final int RS_MESSAGE_TO_CLIENT_EXCEPTION = 1;
static final int RS_MESSAGE_TO_CLIENT_RESIZE = 2;
static final int RS_MESSAGE_TO_CLIENT_ERROR = 3;
static final int RS_MESSAGE_TO_CLIENT_USER = 4;
static final int RS_MESSAGE_TO_CLIENT_NEW_BUFFER = 5;

static final int RS_ERROR_FATAL_DEBUG = 0x0800;
static final int RS_ERROR_FATAL_UNKNOWN = 0x1000;

MessageThread(RenderScript rs) {
super("RSMessageThread");
mRS = rs;

}

public void run() {
// This function is a temporary solution. The final solution will
// used typed allocations where the message id is the type indicator.
int[] rbuf = new int[16];
mRS.nContextInitToClient(mRS.mContext);
while(mRun) {
rbuf[0] = 0;
int msg = mRS.nContextPeekMessage(mRS.mContext, mAuxData);
int size = mAuxData[1];
int subID = mAuxData[0];

if (msg == RS_MESSAGE_TO_CLIENT_USER) {
if ((size>>2) >= rbuf.length) {
rbuf = new int[(size + 3) >> 2];
}
if (mRS.nContextGetUserMessage(mRS.mContext, rbuf) !=
RS_MESSAGE_TO_CLIENT_USER) {
throw new RSDriverException("Error processing message from RenderScript.");
}

if(mRS.mMessageCallback != null) {
mRS.mMessageCallback.mData = rbuf;
mRS.mMessageCallback.mID = subID;
mRS.mMessageCallback.mLength = size;
mRS.mMessageCallback.run();
} else {
throw new RSInvalidStateException("Received a message from the script with no message handler installed.");
}
continue;
}

if (msg == RS_MESSAGE_TO_CLIENT_ERROR) {
String e = mRS.nContextGetErrorMessage(mRS.mContext);

// Throw RSRuntimeException under the following conditions:
//
// 1) It is an unknown fatal error.
// 2) It is a debug fatal error, and we are not in a
// debug context.
// 3) It is a debug fatal error, and we do not have an
// error callback.
if (subID >= RS_ERROR_FATAL_UNKNOWN ||
(subID >= RS_ERROR_FATAL_DEBUG &&
(mRS.mContextType != ContextType.DEBUG ||
mRS.mErrorCallback == null))) {
throw new RSRuntimeException("Fatal error " + subID + ", details: " + e);
}

if(mRS.mErrorCallback != null) {
mRS.mErrorCallback.mErrorMessage = e;
mRS.mErrorCallback.mErrorNum = subID;
mRS.mErrorCallback.run();
} else {
android.util.Log.e(LOG_TAG, "non fatal RS error, " + e);
// Do not throw here. In these cases, we do not have
// a fatal error.
}
continue;
}

if (msg == RS_MESSAGE_TO_CLIENT_NEW_BUFFER) {
if (mRS.nContextGetUserMessage(mRS.mContext, rbuf) !=
RS_MESSAGE_TO_CLIENT_NEW_BUFFER) {
throw new RSDriverException("Error processing message from RenderScript.");
}
long bufferID = ((long)rbuf[1] << 32L) + ((long)rbuf[0] & 0xffffffffL);
Allocation.sendBufferNotification(bufferID);
continue;
}

// 2: teardown.
// But we want to avoid starving other threads during
// teardown by yielding until the next line in the destructor
// can execute to set mRun = false
try {
sleep(1, 0);
} catch(InterruptedException e) {
}
}
//Log.d(LOG_TAG, "MessageThread exiting.");
}
}

关于android.renderscript.RSRuntimeException fatal error 4097,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68728298/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com