{"action":"created","issue":{"url":"https://api.github.com/repos/wequick/Small/issues/271","repository_url":"https://api.github.com/repos/wequick/Small","labels_url":"https://api.github.com/repos/wequick/Small/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/wequick/Small/issues/271/comments","events_url":"https://api.github.com/repos/wequick/Small/issues/271/events","html_url":"https://github.com/wequick/Small/issues/271","id":171124543,"number":271,"title":"第三方库引用来自AppCompat的colorAccent找不到","user":{"login":"mygift2016","id":20549917,"avatar_url":"https://avatars.githubusercontent.com/u/20549917?v=3","gravatar_id":"","url":"https://api.github.com/users/mygift2016","html_url":"https://github.com/mygift2016","followers_url":"https://api.github.com/users/mygift2016/followers","following_url":"https://api.github.com/users/mygift2016/following{/other_user}","gists_url":"https://api.github.com/users/mygift2016/gists{/gist_id}","starred_url":"https://api.github.com/users/mygift2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mygift2016/subscriptions","organizations_url":"https://api.github.com/users/mygift2016/orgs","repos_url":"https://api.github.com/users/mygift2016/repos","events_url":"https://api.github.com/users/mygift2016/events{/privacy}","received_events_url":"https://api.github.com/users/mygift2016/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-15T07:56:04Z","updated_at":"2016-08-19T08:38:15Z","closed_at":"2016-08-19T08:17:42Z","body":"引用 compile 'com.afollestad.material-dialogs:core:0.8.6.2'\r\n来自AppCompat的colorAccent找不到\r\n\r\n报错信息如下：\r\n08-15 15:49:50.281 6967-6967/com.sunfusheng.small E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                                    Process: com.sunfusheng.small, PID: 6967\r\n                                                                    java.lang.NoSuchFieldError: com.afollestad.materialdialogs.R$attr.colorAccent\r\n                                                                        at com.afollestad.materialdialogs.MaterialDialog$Builder.<init>(MaterialDialog.java:494)\r\n                                                                        at com.sunfusheng.small.lib.framework.proxy.handler.BaseHandler.<init>(BaseHandler.java:22)\r\n                                                                        at com.sunfusheng.small.lib.framework.proxy.handler.AsyncActivityHandler.<init>(AsyncActivityHandler.java:9)\r\n                                                                        at com.sunfusheng.small.lib.framework.proxy.helper.ActivityHelper.<init>(ActivityHelper.java:14)\r\n                                                                        at com.sunfusheng.small.lib.framework.base.BaseAsyncActivity.onCreate(BaseAsyncActivity.java:26)\r\n                                                                        at com.sunfusheng.small.lib.framework.base.BaseActivity.onCreate(BaseActivity.java:26)\r\n                                                                        at com.sunfusheng.small.app.main.MainActivity.onCreate(MainActivity.java:46)\r\n                                                                        at android.app.Activity.performCreate(Activity.java:5311)\r\n                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)\r\n                                                                        at net.wequick.small.ApkBundleLauncher$InstrumentationWrapper.callActivityOnCreate(ApkBundleLauncher.java:167)\r\n                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2283)\r\n                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2370)\r\n                                                                        at android.app.ActivityThread.access$800(ActivityThread.java:155)\r\n                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)\r\n                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)\r\n                                                                        at android.os.Looper.loop(Looper.java:136)\r\n                                                                        at android.app.ActivityThread.main(ActivityThread.java:5426)\r\n                                                                        at java.lang.reflect.Method.invokeNative(Native Method)\r\n                                                                        at java.lang.reflect.Method.invoke(Method.java:515)\r\n                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)\r\n                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)\r\n                                                                        at dalvik.system.NativeStart.main(Native Method)"},"comment":{"url":"https://api.github.com/repos/wequick/Small/issues/comments/240961288","html_url":"https://github.com/wequick/Small/issues/271#issuecomment-240961288","issue_url":"https://api.github.com/repos/wequick/Small/issues/271","id":240961288,"user":{"login":"galenlin","id":5291591,"avatar_url":"https://avatars.githubusercontent.com/u/5291591?v=3","gravatar_id":"","url":"https://api.github.com/users/galenlin","html_url":"https://github.com/galenlin","followers_url":"https://api.github.com/users/galenlin/followers","following_url":"https://api.github.com/users/galenlin/following{/other_user}","gists_url":"https://api.github.com/users/galenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/galenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galenlin/subscriptions","organizations_url":"https://api.github.com/users/galenlin/orgs","repos_url":"https://api.github.com/users/galenlin/repos","events_url":"https://api.github.com/users/galenlin/events{/privacy}","received_events_url":"https://api.github.com/users/galenlin/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T08:38:15Z","updated_at":"2016-08-19T08:38:15Z","body":"补充说明下，这个问题是由于第三方aar在代码中引用了外部的一些aar中的资源。比如AppCompat的`R.attr.colorAccent`。\r\n\r\n在原算法中对第三方aar的`R.java`做了特殊处理，只保留自己定义的资源，这样能够使插件最小化。\r\n\r\n为解决这个问题，同时保证插件最小化，现对aar的`classes.jar`中的class文件进行解析，收集所有引用到的`R.*.*`字段，并保留到上述`R.java`中。\r\n\r\n相关的代码改动见 1bdd0d2"}}
{"actor":{"display_login":"galenlin"}}