AlexLiuSheng / CheckVersionLib

版本检测升级(更新)库。an auto check version library(app update) on Android
https://github.com/AlexLiuSheng/CheckVersionLib
2.67k stars 484 forks source link

AndroidP适配问题 #251

Open fanzhiqiang123 opened 5 years ago

fanzhiqiang123 commented 5 years ago

安卓9.0通知问题,无法跳转下载对话框,并且无法提示安装页面

fanzhiqiang123 commented 5 years ago

此问题已解决,但是遇到新问题,无法启动前台服务,您的例子可以正常启动前台服务,我的测试程序中会出现Bad notification for startForeground,是不是要使用该库必须要和该库的包名一致或者直接导入库后修改库的包名和我的一致才能行?

fanzhiqiang123 commented 5 years ago

这是错误信息android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid service notification: Notification(channel=version_service_id pri=0 contentView=com.yaoban.wsms/0x1090096 vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)求大神指点,弄了一晚上也每搞定,快怀疑人生了

AlexLiuSheng commented 5 years ago

你有自定义通知么 把你构建通知的代码发出来

fanzhiqiang123 commented 5 years ago

你有自定义通知么 把你构建通知的代码发出来

昨天晚上没有自定义通知。今早上试着把您的自定义通知拷贝过来修改了一下icon和Ticker还有通知相应的内容。例子中有加视频相关的库,库要求targetSdkVersion<=22,我想会不会是这个的原因导致的上面的错误信息.并且早上有新建一个另一个demo,该demo运行是完全没有任何异常出现的。

fanzhiqiang123 commented 5 years ago

大神您好,发现一个新异常,Android9.0手机debug模式在下载进度框读条的时候直接按Home键不会闪退,但是release版本的apk会出现闪退异常

AlexLiuSheng commented 5 years ago

开了混淆的?

fanzhiqiang123 commented 5 years ago

开了混淆的?

是的,添加了混淆

AlexLiuSheng commented 5 years ago

你看报错是什么原因 -keepattributes Annotation -keepclassmembers class * { @org.greenrobot.eventbus.Subscribe ; } -keep enum org.greenrobot.eventbus.ThreadMode { ; } -keepclassmembers class extends org.greenrobot.eventbus.util.ThrowableFailureEvent { (java.lang.Throwable); } -keep class com.allenliu.versionchecklib.*{;}

fanzhiqiang123 commented 5 years ago

我认为是混淆配置问题,在网上找到一段EventBus的混淆代码 -keepattributes Annotation -keepclassmembers class * { @org.greenrobot.eventbus.Subscribe ; } -keep enum org.greenrobot.eventbus.ThreadMode { ; }

Only required if you use AsyncExecutor

-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {

(java.lang.Throwable); } 不知道该混淆配置代码和您的有什么区别, Only required if you use AsyncExecutor,我例子中有用到异步任务执行器。
fanzhiqiang123 commented 5 years ago

已经解决了,感谢大神在百忙抽空回复。我把上面贴的混淆代码替换之前的混淆代码就ok了

winnxiegang commented 5 years ago

这是错误信息android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid service notification: Notification(channel=version_service_id pri=0 contentView=com.yaoban.wsms/0x1090096 vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)求大神指点,弄了一晚上也每搞定,快怀疑人生了

请问这个问题怎么结局的 ?我的也是自定义通知栏