Shadowsocks-android: beta 分支编译的版本会 crash

Created on 20 Dec 2017  ·  12Comments  ·  Source: shadowsocks/shadowsocks-android

环境
Nexus 4 模拟器 API 25

复现过程
打开 app, 随意点击几下就崩溃了

12-20 09:21:00.047 9658-9658/com.github.shadowsocks E/AndroidRuntime: FATAL EXCEPTION: main
                    Process: com.github.shadowsocks, PID: 9658
                    java.lang.NullPointerException: Attempt to read from field 'int android.support.v4.provider.FontsContractCompat$TypefaceResult.mResult' on a null object reference
                        at android.support.v4.provider.FontsContractCompat$2.onReply(FontsContractCompat.java:277)
                        at android.support.v4.provider.FontsContractCompat$2.onReply(FontsContractCompat.java:274)
                        at android.support.v4.provider.FontsContractCompat$3.onReply(FontsContractCompat.java:312)
                        at android.support.v4.provider.FontsContractCompat$3.onReply(FontsContractCompat.java:300)
                        at android.support.v4.provider.SelfDestructiveThread$2$1.run(SelfDestructiveThread.java:149)
                        at android.os.Handler.handleCallback(Handler.java:751)
                        at android.os.Handler.dispatchMessage(Handler.java:95)
                        at android.os.Looper.loop(Looper.java:154)
                        at android.app.ActivityThread.main(ActivityThread.java:6119)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
bug

All 12 comments

I guess that's why "device must have Google Play services version 11 or higher to use the Google Fonts provider".

I can't reproduce this issue on Android API 19 (no Google API) emulator. And I can't find a emulator image for API 25 without Google API.

Hmm, without Google API, how could it work?

我那个 API 25 的模拟器是有 Google APIs 的.

On my side, it just uses a regular font instead. We could use a hardcoded
xml font instead to solve that issue (and possibly this).

@Mygod Do you mean we just roll back to "the old way"?

@madeye Not exactly. It means we will use font support in support library.

Please try 6c89207.

好,感谢 dalao, 周一再试试了

@madeye I think the old one is already using fonts thru support lib. See stack trace.

Maybe we also need to handle that exception in our code, since it looks a bug of Google.

@madeye I can reproduce the crash with airplane mode on in virtual device. https://github.com/shadowsocks/shadowsocks-android/commit/6c89207eff94c90a2ac20a82a7eeac1a12c6210d didn't fix it. Let's use xml font instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tamashii picture tamashii  ·  5Comments

libook picture libook  ·  4Comments

CzBiX picture CzBiX  ·  3Comments

theScrabi picture theScrabi  ·  5Comments

Mygod picture Mygod  ·  5Comments