Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

unknown reference to sun.misc.Unsafe in play-services #116

Open
Palatis opened this issue Mar 25, 2016 · 3 comments
Open

unknown reference to sun.misc.Unsafe in play-services #116

Palatis opened this issue Mar 25, 2016 · 3 comments

Comments

@Palatis
Copy link

Palatis commented Mar 25, 2016

first apologize that I'm lazy to make a pull request...

api23+ is building with OpenJDK instead of Oracle JDK, which doesn't have sun.misc.Unsafe.

adding

-dontwarn com.google.common.cache.**
-dontwarn com.google.common.primitives.UnsignedBytes$**

to proguard-google-play-services.pro fixes warning:

Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning: com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1: can't find referenced class sun.misc.Unsafe

which renderes "Generate signed APK" to fail.

I dunno what side-effects would this introduce, tho.

@90Sachin
Copy link

90Sachin commented Sep 6, 2016

Use this
-keep class com.google.**
-dontwarn com.google.**

@krishnameena
Copy link

Thanks. you saved my day.

@LouisCAD
Copy link

No need to prevent proguarding of all Protobuf.
Just remove the warning for the referenced class with this in your proguard rules:
-dontwarn sun.misc.Unsafe
This will help make your apk smaller while ditching the warnings

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants