- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的 android 项目中启用 D8 后,我开始看到这些警告:
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `sun.misc.Unsafe com.google.common.cache.Striped64.getUnsafe()`
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `sun.misc.Unsafe com.google.common.hash.LittleEndianByteArray$UnsafeByteArray.getUnsafe()`
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `sun.misc.Unsafe com.google.common.cache.Striped64.getUnsafe()`
/Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `sun.misc.Unsafe com.google.common.hash.LittleEndianByteArray$UnsafeByteArray.getUnsafe()`
.
项目构建成功,但在运行时,我看到这些错误日志,因此,应用程序功能受到影响。
java.lang.AbstractMethodError: abstract method "java.lang.Object com.google.common.base.e.a(java.lang.Object)"
at com.google.common.e.a.i$c.a(SourceFile:1464)
at com.google.common.e.a.i$c.a(SourceFile:1453)
at com.google.common.e.a.i$a.run(SourceFile:1408)
at com.google.common.e.a.l$a.execute(SourceFile:456)
at com.google.common.e.a.i$f.a(SourceFile:153)
at com.google.common.e.a.i.a(SourceFile:1234)
搜索了一段时间后,我没能找到任何有用的东西。请帮忙。
是的,如果禁用 D8 并且其他一切都保持不变,我不会在运行时遇到此错误。
最佳答案
你需要保持sun.misc.Unsafe
:
-keep class sun.misc.Unsafe { *; }
-dontnote sun.misc.Unsafe
或者,带有includedescriptorclasses
的规则应该保持动态:
-keep,includedescriptorclasses class com.google.common.**
一般来说:
添加开关-verbose
对编写ProGuard配置规则很有帮助。
添加开关-dontoptimize
可用于禁用所有优化,以供测试。
刚找到this :
R8 now understands proguard specs in META-INF/proguard.
但除非已添加,否则必须添加自定义规则 - 而不是使用消费者规则。
关于android - D8 : Type `sun.misc.Unsafe` was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53665135/
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
在我正在开发的 crate 中,我有几个 unsafe 函数,由于某些原因它们被标记为 explained in this answer .在 unsafe 函数中,我可以执行 unsafe 操作,就
我一直在尝试在我的网络应用程序中设置文本编辑器。在哪里访问文本编辑器我必须允许 script-src 'self' 'unsafe-inline' 'unsafe-eval' 和 style-src
我是后端开发人员,正在帮助前端团队部署 Web 服务器,同时我正在研究遇到内容安全策略的漏洞,如果我将 CSP header 设置为“内容安全策略:默认源代码‘自我’数据: {own_domain_1
Unsafe.putAddress(long address, long x) 之间有什么区别?方法和Unsafe.putLong(long address, long x)方法? 最佳答案 Java
考虑以下代码: const defaultState = () => { return { profile: { id: '', displayName: '',
上面有一条评论 public native void unpark(对象线程); “取消阻塞在park上阻塞的给定线程,或者,如果它没有阻塞,则导致后续对park的调用不阻塞。注意:此操作“不安全”,
我已将 unsafe.cpp 和 Unsafe.java 克隆到自定义版本。我要构建新的 JVM,但似乎我的 UnsafeNew.java 内联了 unsafe.cpp 方法,而不是新的 unsafe
为什么会出现以下错误? Unsafe code may only appear if compiling with /unsafe"? 我使用 C# 和 Visual Studio 2008 在 Wi
我正在用 C# 做一个项目,它可以从线性代数包中获益。我看过外面的那些,但我真的不想付钱,或者我发现它们不是很好。所以我决定自己写。 我读到 C++ 数组比 C# 数组快得多,但在 C# 中使用指针数
在 Java 中,java.lang.unsafe 包中有 Unsafe 类,它提供对操作的低级访问。 现在在我看来,JVM 需要支持Unsafe 类中可用的所有 方法,以便与 JLS 兼容,示例方法
我正在尝试将选项卡存储在本地存储中并在刷新页面上获取前面的选项卡,数据存储在本地但是在控制台上的时候我得到错误 Error: [$sce:unsafe] Attempting to use an un
导入类型化函数时,我收到 no-unsafe-call 和 no-unsafe-assignment eslint 错误。如果函数在同一个文件中声明,错误就会消失。 eslint 似乎无法获取导入函数
我正在尝试在 Visual Studio App Center 中构建 Xamarin iOS 应用程序。该解决方案包含两个项目。一个是 Xamarin iOS 项目。另一个是绑定(bind)库项目。
Unsafe Fileupload 1.client check 标题叫客户端check,文件校验应该是在客户端进行的。 可以先把一句话木马改成图片格式,然后再抓包修改回PHP格式。 一句话木马内容:
我想问一下第一个例子是否比第二个例子慢。 例子1:for, unsafe, unsafe, unsafe, etc for (var i = 0; i ' { } // end of class .
我尝试通过在 Controller 中生成链接将书签按钮添加到我的网站。 模板部分: + Add Controller 部分: $scope.getCode = fun
我注意到在 Java 7 中,集合类(在我的例子中是 ConcurrentLinkedQueue)使用 UNSAFE 类进行交换和查找操作。 偏移量似乎是在编译时声明中计算的: itemOffset
我有一张图片: 在 html 上我得到的结果是: unsafe:c:/var/vci/images/fleetImages/IMG_20150912_091552.jpg 我已经在app.js中添加
这是实现原生pinvok代码的类 虽然我无法验证它是否正确使用了 unsafe,但它似乎可以工作 不安全的签名 struct IO_COUNTERS { public
我是一名优秀的程序员,十分优秀!