剛剛學習React-Native,感謝前人挖井,今天有一點自己的收穫,寫下來回報社會;
1.oppo手機安裝應用閃退,
異常日誌:
RuntimeException: Unable to instantiate application xxx.xxx.xxx.MainApplication: java.lang.ClassNotFoundException: Didn't find class "xxx.xxx.xxx.MainApplication" on path: DexPathList[[zip file "/data/app/com.yuanda.stock-jmjLVQsrUk6UqNH-lcohtg==/base.apk"],nativeLibraryDirectories=[/data/app/xxx.xxx.xxx-jmjLVQsrUk6UqNH-lcohtg==/lib/arm, /system/fake-libs, /data/app/xxx.xxx.xxx-jmjLVQsrUk6UqNH-lcohtg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
複製程式碼
此問題的解決方案:
真機搖晃後調出的除錯選單如下(此截圖為ios,android類似)
異常日誌如下:
android.view.WindowManager$BadTokenException:
Unable to add window android.view.ColorViewRootImplHooks$ColorW@c1e5853 -- permission denied for window type 2003
at android.view.ViewRootImpl.setView(ViewRootImpl.java:940)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:385)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.app.Dialog.show(Dialog.java:388)
at com.facebook.react.devsupport.DevSupportManagerImpl.showDevOptionsDialog(DevSupportManagerImpl.java:477)
at com.facebook.react.devsupport.DevSupportManagerImpl$1.onShake(DevSupportManagerImpl.java:202)
at com.facebook.react.common.ShakeDetector.maybeDispatchShake(ShakeDetector.java:146)
at com.facebook.react.common.ShakeDetector.onSensorChanged(ShakeDetector.java:114)
複製程式碼
解決方案:此問題為許可權問題,因為8.0後許可權api的變更導致,原來api則無效
方案1:
修改build.gradle中的 targetSdkVersion 23;
targetSdkVersion 23是一個神奇的版本,這個版本不需要動態申請許可權
方案2:
借鑑"簡書"javanHuang的<<Android8.0通知欄和懸浮窗新改動>>
最後祝大家工作順利,生活愉快,第一次寫部落格,如有不對之處大家多多指正,共同進步;
作者:小虎灬灬 來源:CSDN 原文:blog.csdn.net/qq_24971275… 版權宣告:本文為博主原創文章,轉載請附上博文連結!