{"action":"created","issue":{"url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/569","repository_url":"https://api.github.com/repos/koral--/android-gif-drawable","labels_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/569/labels{/name}","comments_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/569/comments","events_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/569/events","html_url":"https://github.com/koral--/android-gif-drawable/issues/569","id":340798964,"node_id":"MDU6SXNzdWUzNDA3OTg5NjQ=","number":569,"title":"App crashes at launch ","user":{"login":"devxpy","id":19492893,"node_id":"MDQ6VXNlcjE5NDkyODkz","avatar_url":"https://avatars1.githubusercontent.com/u/19492893?v=4","gravatar_id":"","url":"https://api.github.com/users/devxpy","html_url":"https://github.com/devxpy","followers_url":"https://api.github.com/users/devxpy/followers","following_url":"https://api.github.com/users/devxpy/following{/other_user}","gists_url":"https://api.github.com/users/devxpy/gists{/gist_id}","starred_url":"https://api.github.com/users/devxpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devxpy/subscriptions","organizations_url":"https://api.github.com/users/devxpy/orgs","repos_url":"https://api.github.com/users/devxpy/repos","events_url":"https://api.github.com/users/devxpy/events{/privacy}","received_events_url":"https://api.github.com/users/devxpy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-12T21:08:44Z","updated_at":"2018-07-13T01:23:01Z","closed_at":"2018-07-13T01:23:01Z","author_association":"NONE","body":"Android 7.1.2, nexus 5,    Flutter 0.5.1 \r\n\r\nSorry for new issue, I couldn't figure out what exactly to look for.\r\n\r\nbuild.gradle\r\n```gradle\r\n....\r\nbuildscript {\r\n    repositories {\r\n        mavenCentral()\r\n    }\r\n}\r\nallprojects {\r\n    repositories {\r\n        mavenCentral()\r\n    }\r\n}\r\n\r\n\r\nandroid {\r\n    compileSdkVersion 28\r\n    ....\r\n    dependencies {\r\n        implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.10'\r\n    }\r\n}\r\n...\r\n```\r\n\r\nandroid/app/src/main/res/drawable/launch_background.xml \r\n```xml\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n    <item>\r\n        <pl.droidsonroids.gif.GifImageView\r\n            android:gravity=\"center\"\r\n            android:src=\"@mipmap/launch_image\"\r\n            android:background=\"@android:color/black\"\r\n            />\r\n    </item>\r\n</layer-list>\r\n```\r\n\r\n```\r\n07-13 02:28:28.208   765   790 W WindowManager: Token{fbe5770 ActivityRecord{cc3f5b3 u0 com.pycampers.securepdfviewer/.MainActivity t108}} failed creating starting window\r\n07-13 02:28:28.208   765   790 W WindowManager: android.content.res.Resources$NotFoundException: Drawable com.pycampers.securepdfviewer:drawable/launch_background with resource ID #0x7f020000\r\n07-13 02:28:28.208   765   790 W WindowManager: Caused by: android.content.res.Resources$NotFoundException: File res/drawable/launch_background.xml from drawable resource ID #0x7f020000\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:725)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:571)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.content.res.Resources.getDrawable(Resources.java:771)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.content.Context.getDrawable(Context.java:525)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2578)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2628)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2047)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.server.policy.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:2821)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:8389)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.os.Looper.loop(Looper.java:154)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.os.HandlerThread.run(HandlerThread.java:61)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat com.android.server.ServiceThread.run(ServiceThread.java:46)\r\n07-13 02:28:28.208   765   790 W WindowManager: Caused by: android.view.InflateException: Class not found pl.droidsonroids.gif.GifImageView\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.DrawableInflater.inflateFromClass(DrawableInflater.java:206)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:128)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.LayerDrawable.inflateLayers(LayerDrawable.java:285)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:196)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.Drawable.createFromXml(Drawable.java:1200)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:715)\r\n07-13 02:28:28.208   765   790 W WindowManager: \t... 12 more\r\n07-13 02:28:28.208   765   790 W WindowManager: Caused by: java.lang.ClassNotFoundException: Didn't find class \"pl.droidsonroids.gif.GifImageView\" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/Settings/lib/arm, /system/priv-app/Settings/Settings.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/lib, /vendor/lib]]\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat java.lang.ClassLoader.loadClass(ClassLoader.java:380)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat java.lang.ClassLoader.loadClass(ClassLoader.java:312)\r\n07-13 02:28:28.208   765   790 W WindowManager: \tat android.graphics.drawable.DrawableInflater.inflateFromClass(DrawableInflater.java:187)\r\n07-13 02:28:28.208   765   790 W WindowManager: \t... 20 more\r\n07-13 02:28:28.221 18235 18235 I art     : Late-enabling -Xcheck:jni\r\n07-13 02:28:28.221   765   776 I ActivityManager: Start proc 18235:com.pycampers.securepdfviewer/u0a148 for activity com.pycampers.securepdfviewer/.MainActivity\r\n07-13 02:28:28.302 18235 18235 D AndroidRuntime: Shutting down VM\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: FATAL EXCEPTION: main\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: Process: com.pycampers.securepdfviewer, PID: 18235\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pycampers.securepdfviewer/com.pycampers.securepdfviewer.MainActivity}: android.content.res.Resources$NotFoundException: Drawable com.pycampers.securepdfviewer:drawable/launch_background with resource ID #0x7f020000\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.-wrap12(ActivityThread.java)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.os.Looper.loop(Looper.java:154)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.main(ActivityThread.java:6121)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat java.lang.reflect.Method.invoke(Native Method)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Drawable com.pycampers.securepdfviewer:drawable/launch_background with resource ID #0x7f020000\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: File res/drawable/launch_background.xml from drawable resource ID #0x7f020000\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:725)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:571)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.content.res.Resources.getDrawable(Resources.java:771)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.content.Context.getDrawable(Context.java:525)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2578)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2628)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2047)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat io.flutter.app.FlutterActivityDelegate.onCreate(FlutterActivityDelegate.java:155)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat io.flutter.app.FlutterActivity.onCreate(FlutterActivity.java:86)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.pycampers.securepdfviewer.MainActivity.onCreate(MainActivity.java:11)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.Activity.performCreate(Activity.java:6682)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.-wrap12(ActivityThread.java)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.os.Looper.loop(Looper.java:154)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.app.ActivityThread.main(ActivityThread.java:6121)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat java.lang.reflect.Method.invoke(Native Method)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: Caused by: android.view.InflateException: Class is not a Drawable pl.droidsonroids.gif.GifImageView\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.DrawableInflater.inflateFromClass(DrawableInflater.java:200)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:128)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.LayerDrawable.inflateLayers(LayerDrawable.java:285)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:196)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.Drawable.createFromXml(Drawable.java:1200)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:715)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \t... 21 more\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: Caused by: java.lang.ClassCastException: class pl.droidsonroids.gif.GifImageView cannot be cast to android.graphics.drawable.Drawable\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat java.lang.Class.asSubclass(Class.java:2340)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \tat android.graphics.drawable.DrawableInflater.inflateFromClass(DrawableInflater.java:187)\r\n07-13 02:28:28.304 18235 18235 E AndroidRuntime: \t... 29 more\r\n07-13 02:28:28.307   765   776 W ActivityManager:   Force finishing activity com.pycampers.securepdfviewer/.MainActivity\r\n```"},"comment":{"url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/comments/404697564","html_url":"https://github.com/koral--/android-gif-drawable/issues/569#issuecomment-404697564","issue_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/569","id":404697564,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDY5NzU2NA==","user":{"login":"koral--","id":3340954,"node_id":"MDQ6VXNlcjMzNDA5NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3340954?v=4","gravatar_id":"","url":"https://api.github.com/users/koral--","html_url":"https://github.com/koral--","followers_url":"https://api.github.com/users/koral--/followers","following_url":"https://api.github.com/users/koral--/following{/other_user}","gists_url":"https://api.github.com/users/koral--/gists{/gist_id}","starred_url":"https://api.github.com/users/koral--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koral--/subscriptions","organizations_url":"https://api.github.com/users/koral--/orgs","repos_url":"https://api.github.com/users/koral--/repos","events_url":"https://api.github.com/users/koral--/events{/privacy}","received_events_url":"https://api.github.com/users/koral--/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T01:23:01Z","updated_at":"2018-07-13T01:23:01Z","author_association":"OWNER","body":"Assuming that you have `launch_image.gif` file in your mipmap folder, something like this:\r\n```xml\r\n        <pl.droidsonroids.gif.GifImageView\r\n            android:gravity=\"center\"\r\n            android:src=\"@mipmap/launch_image\"\r\n            android:background=\"@android:color/black\"\r\n            />\r\n```\r\nwill work but you need to place it inside layout XML (not drawable).\r\nLook at the sample code: https://github.com/koral--/android-gif-drawable/blob/dev/sample/src/main/res/layout/texture.xml#L32"}}
{"actor":{"display_login":"koral--"}}