通知报错

https://stackoverflow.com/questions/25317659/how-to-fix-android-app-remoteserviceexception-bad-notification-posted-from-pac

 

In my app, this kind of bug happens only during upgrading. If the resource id changes in the newer version, Android RemoteView may fail to find the resource and throw out the RemoteServiceException. If you publish a 3rd version and do not change the resource id, the bugs may disappear only temporarily.

It is possible to reduce this kind of bugs by editing res/values/public.xml and res/values/ids.xml. Compiler will generate an individual resource id if the resource id is not in public.xml or ids.xml. When u change the resource name or add some new resources, the id may change and some devices may fail to find it. 

So the step is as following:

  1. Decompile the apk file and in res/values find the public.xml and ids.xml
  2. Find all resources related to RemoteView in your app and copy them ( strings, dimen, drawable, layout, id, color... )
  3. Create public.xml and ids.xml under res/values in your source code and paste the lines u just copied

Note:

Gradle 1.3.0 and above ignore the local public.xml. To make it work, u need to add some script in your build.gradle

afterEvaluate {
    for (variant in android.applicationVariants) {
        def scope = variant.getVariantData().getScope()
        String mergeTaskName = scope.getMergeResourcesTask().name
        def mergeTask = tasks.getByName(mergeTaskName)
        mergeTask.doLast {
            copy {
                int i=0
                from(android.sourceSets.main.res.srcDirs) {
                    include 'values/public.xml'
                    rename 'public.xml', (i == 0? "public.xml": "public_${i}.xml")
                    i++
                }
                into(mergeTask.outputDir)
            }
        }
    }
}
### Jenkins QQ Email Notification Error Solution For integrating Jenkins with QQ's email service, several configurations are necessary both within the Jenkins setup and concerning the external mail server settings provided by QQ. When encountering errors while setting up this integration, it is important to verify multiple aspects. In terms of configuring Jenkins for sending emails via QQ’s SMTP server, ensure that the following parameters are correctly set in the system configuration section under “E-mail Notification”: - **SMTP Server**: smtp.qq.com - **Default user e-mail suffix**: This field can be left blank or filled according to specific requirements. - **SMTP Port Number**: Typically 465 (SSL) or 587 (TLS). - **Use SSL/TLS**: Enable as required depending on which port number has been chosen[^1]. Additionally, authentication credentials must match those associated with your QQ Mail account used specifically for these notifications. It may also prove beneficial to check whether less secure apps access permission needs enabling from within QQ security settings since some services require explicit allowance before functioning properly[^2]. If issues persist after verifying all above points, consider examining logs generated during build processes where such failures occur; they often contain valuable clues regarding what might have gone wrong. Also, confirming network connectivity between the machine running Jenkins and QQ servers could help rule out potential firewall blocks or similar obstacles preventing successful communication. ```bash telnet smtp.qq.com 465 ``` This command tests connection ability directly towards QQ's designated SMTP endpoint using an encrypted channel specified earlier when choosing ports.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值