{"action":"created","issue":{"url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/12","repository_url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch","labels_url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/12/comments","events_url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/12/events","html_url":"https://github.com/transistorsoft/nativescript-background-fetch/issues/12","id":362331139,"node_id":"MDU6SXNzdWUzNjIzMzExMzk=","number":12,"title":"Background Fetch Headless Class Not Found Exception","user":{"login":"ssulei7","id":22037844,"node_id":"MDQ6VXNlcjIyMDM3ODQ0","avatar_url":"https://avatars3.githubusercontent.com/u/22037844?v=4","gravatar_id":"","url":"https://api.github.com/users/ssulei7","html_url":"https://github.com/ssulei7","followers_url":"https://api.github.com/users/ssulei7/followers","following_url":"https://api.github.com/users/ssulei7/following{/other_user}","gists_url":"https://api.github.com/users/ssulei7/gists{/gist_id}","starred_url":"https://api.github.com/users/ssulei7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssulei7/subscriptions","organizations_url":"https://api.github.com/users/ssulei7/orgs","repos_url":"https://api.github.com/users/ssulei7/repos","events_url":"https://api.github.com/users/ssulei7/events{/privacy}","received_events_url":"https://api.github.com/users/ssulei7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-20T19:26:55Z","updated_at":"2018-09-20T19:28:37Z","closed_at":null,"author_association":"NONE","body":"When I try to enable headless mode on Android 8.1 / Nexus 6P, I get an error `java.lang.ClassNotFoundException`. We are running the latest version of NativeScript and the latest available version of your plugin. Not sure if relevant, but we're also using your background geolocation plugin.\r\n\r\n\tBackgroundFetch.registerHeadlessTask(async () => {\r\n\t\tconsole.log('[My BackgroundFetch HeadlessTask] onFetch');    \r\n\t\t// Do some asynchronous work (eg: HTTP Request)\r\n\t\t\r\n\t\t// Politely signal to the OS that our processing is complete.\r\n\t\tBackgroundFetch.finish();\r\n\t});\r\n\r\n\t// Configure Background Fetch\r\n\tBackgroundFetch.configure({\r\n\t\tstopOnTerminate: false,\r\n\t\tstartOnBoot: true,\r\n\t\tenableHeadless: true\r\n\t}, () => {\r\n\t\tconsole.log(\"[js] BackgroundFetch event received\");\r\n\t\t// do stuff\r\n\t\tconsole.log(\"[js] BackgroundFetch event completed\");\r\n\t}, (status) => {\r\n\t\tconsole.log('BackgroundFetch not supported by your OS', status);\r\n\t});\r\n\r\n**This is the log of the error:**\r\n\r\n\tSystem.err: java.lang.ClassNotFoundException: com.transistorsoft.backgroundfetch.HeadlessJobService\r\n\tSystem.err:     at java.lang.Class.classForName(Native Method)\r\n\tSystem.err:     at java.lang.Class.forName(Class.java:453)\r\n\tSystem.err:     at java.lang.Class.forName(Class.java:378)\r\n\tSystem.err:     at com.transistorsoft.tsbackgroundfetch.BackgroundFetch.onFetch(BackgroundFetch.java:176)\r\n\tSystem.err:     at com.transistorsoft.tsbackgroundfetch.BackgroundFetch.onFetch(BackgroundFetch.java:151)\r\n\tSystem.err:     at com.transistorsoft.tsbackgroundfetch.FetchJobService.onStartJob(FetchJobService.java:22)\r\n\tSystem.err:     at android.app.job.JobService$1.onStartJob(JobService.java:71)\r\n\tSystem.err:     at android.app.job.JobServiceEngine$JobHandler.handleMessage(JobServiceEngine.java:108)\r\n\tSystem.err:     at android.os.Handler.dispatchMessage(Handler.java:106)\r\n\tSystem.err:     at android.os.Looper.loop(Looper.java:164)\r\n\tSystem.err:     at android.app.ActivityThread.main(ActivityThread.java:6494)\r\n\tSystem.err:     at java.lang.reflect.Method.invoke(Native Method)\r\n\tSystem.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)\r\n\tSystem.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)\r\n\tSystem.err: Caused by: java.lang.ClassNotFoundException: Didn't find class \"com.transistorsoft.backgroundfetch.HeadlessJobService\" on path: DexPathList[[zip file \"/data/app/com.test.app-hFj8-9wq6p-ke3BOsoW15Q==/base.apk\"],nativeLibraryDirectories=[/data/app/com.test.app-hFj8-9wq6p-ke3BOsoW15Q==/lib/arm, /data/app/com.test.app-hFj8-9wq6p-ke3BOsoW15Q==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]\r\n\tSystem.err:     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)\r\n\tSystem.err:     at java.lang.ClassLoader.loadClass(ClassLoader.java:379)\r\n\tSystem.err:     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)\r\n\tSystem.err:     ... 14 more\r\n\r\n\r\nAny ideas? A full re-build didn't help."},"comment":{"url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/comments/423304239","html_url":"https://github.com/transistorsoft/nativescript-background-fetch/issues/12#issuecomment-423304239","issue_url":"https://api.github.com/repos/transistorsoft/nativescript-background-fetch/issues/12","id":423304239,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzMwNDIzOQ==","user":{"login":"christocracy","id":14999,"node_id":"MDQ6VXNlcjE0OTk5","avatar_url":"https://avatars1.githubusercontent.com/u/14999?v=4","gravatar_id":"","url":"https://api.github.com/users/christocracy","html_url":"https://github.com/christocracy","followers_url":"https://api.github.com/users/christocracy/followers","following_url":"https://api.github.com/users/christocracy/following{/other_user}","gists_url":"https://api.github.com/users/christocracy/gists{/gist_id}","starred_url":"https://api.github.com/users/christocracy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christocracy/subscriptions","organizations_url":"https://api.github.com/users/christocracy/orgs","repos_url":"https://api.github.com/users/christocracy/repos","events_url":"https://api.github.com/users/christocracy/events{/privacy}","received_events_url":"https://api.github.com/users/christocracy/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T19:28:37Z","updated_at":"2018-09-20T19:28:37Z","author_association":"MEMBER","body":"Ensure you’re using latest background-fetch"}}
{"actor":{"display_login":"christocracy"}}