{"action":"created","issue":{"url":"https://api.github.com/repos/sockeqwe/mosby/issues/159","repository_url":"https://api.github.com/repos/sockeqwe/mosby","labels_url":"https://api.github.com/repos/sockeqwe/mosby/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/sockeqwe/mosby/issues/159/comments","events_url":"https://api.github.com/repos/sockeqwe/mosby/issues/159/events","html_url":"https://github.com/sockeqwe/mosby/issues/159","id":175259277,"number":159,"title":"IllegalArgumentException: class java.lang.Object is not an interface","user":{"login":"Maragues","id":655970,"avatar_url":"https://avatars.githubusercontent.com/u/655970?v=3","gravatar_id":"","url":"https://api.github.com/users/Maragues","html_url":"https://github.com/Maragues","followers_url":"https://api.github.com/users/Maragues/followers","following_url":"https://api.github.com/users/Maragues/following{/other_user}","gists_url":"https://api.github.com/users/Maragues/gists{/gist_id}","starred_url":"https://api.github.com/users/Maragues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maragues/subscriptions","organizations_url":"https://api.github.com/users/Maragues/orgs","repos_url":"https://api.github.com/users/Maragues/repos","events_url":"https://api.github.com/users/Maragues/events{/privacy}","received_events_url":"https://api.github.com/users/Maragues/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-09-06T14:18:44Z","updated_at":"2016-09-06T16:12:36Z","closed_at":null,"body":"This stacktrace is shown when attempting to detach an Activity that uses *MvpNullObjectBasePresenter* but does not implement any Interface\r\n\r\n```\r\njava.lang.RuntimeException: Unable to destroy activity {com.mypackage/com.mypackage.ui.account.AccountActivity}: java.lang.IllegalArgumentException: class java.lang.Object is not an interface\r\nat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3831)\r\nat android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849)\r\n        at android.app.ActivityThread.-wrap5(ActivityThread.java)\r\n        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)\r\n        at android.os.Handler.dispatchMessage(Handler.java:102)\r\n        at android.os.Looper.loop(Looper.java:148)\r\n        at android.app.ActivityThread.main(ActivityThread.java:5422)\r\n        at java.lang.reflect.Method.invoke(Native Method)\r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\n        Caused by: java.lang.IllegalArgumentException: class java.lang.Object is not an interface\r\nat java.lang.reflect.Proxy.getProxyClass(Proxy.java:147)\r\n        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:228)\r\n        at com.hannesdorfmann.mosby.mvp.NoOp.of(NoOp.java:41)\r\n        at com.hannesdorfmann.mosby.mvp.MvpNullObjectBasePresenter.detachView(MvpNullObjectBasePresenter.java:42)\r\n        at com.hannesdorfmann.mosby.mvp.delegate.MvpInternalDelegate.detachView(MvpInternalDelegate.java:70)\r\n        at com.hannesdorfmann.mosby.mvp.delegate.ActivityMvpDelegateImpl.onDestroy(ActivityMvpDelegateImpl.java:71)\r\n        at com.hannesdorfmann.mosby.mvp.MvpActivity.onDestroy(MvpActivity.java:47)\r\n        at android.app.Activity.performDestroy(Activity.java:6422)\r\n        at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1142)\r\n        at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818)\r\n        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849) \r\n        at android.app.ActivityThread.-wrap5(ActivityThread.java) \r\n        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) \r\n        at android.os.Handler.dispatchMessage(Handler.java:102) \r\n        at android.os.Looper.loop(Looper.java:148) \r\n        at android.app.ActivityThread.main(ActivityThread.java:5422) \r\n        at java.lang.reflect.Method.invoke(Native Method) \r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) \r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) \r\n```\r\n\r\nI feel that the error message could be improved by checking in *MvpNullObjectBasePresenter* if the class to be detached implements *MvpView*, but I'm not sure if that's the best way, I haven't dig too much into Mosby code\r\n\r\n```\r\nClass<V> viewClass = (Class<V>) types[0];\r\n//add check here? Throw an Exception if it doesn't implement MvpView?\r\nview = NoOp.of(viewClass);\r\n```\r\n\r\nAlso, this error is only happening in release version with ProGuard. It's been in development like that for months and it hasn't crashed."},"comment":{"url":"https://api.github.com/repos/sockeqwe/mosby/issues/comments/245003128","html_url":"https://github.com/sockeqwe/mosby/issues/159#issuecomment-245003128","issue_url":"https://api.github.com/repos/sockeqwe/mosby/issues/159","id":245003128,"user":{"login":"Maragues","id":655970,"avatar_url":"https://avatars.githubusercontent.com/u/655970?v=3","gravatar_id":"","url":"https://api.github.com/users/Maragues","html_url":"https://github.com/Maragues","followers_url":"https://api.github.com/users/Maragues/followers","following_url":"https://api.github.com/users/Maragues/following{/other_user}","gists_url":"https://api.github.com/users/Maragues/gists{/gist_id}","starred_url":"https://api.github.com/users/Maragues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maragues/subscriptions","organizations_url":"https://api.github.com/users/Maragues/orgs","repos_url":"https://api.github.com/users/Maragues/repos","events_url":"https://api.github.com/users/Maragues/events{/privacy}","received_events_url":"https://api.github.com/users/Maragues/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T16:12:36Z","updated_at":"2016-09-06T16:12:36Z","body":"Thanks to you for the time you devote to the community!"}}
{"actor":{"display_login":"Maragues"}}