pusheco / pushe-flutter

Pushe plugin for Flutter framework
Other
14 stars 4 forks source link

Cannot initialize Firebase Messaging with null Firebase App #4

Closed imelyas closed 5 years ago

imelyas commented 5 years ago

Hi I'm using pushe-flutter v1.0.1. but Pushe doesn't initialize and I have this error: What should I do to resolve this? Thanks a lot.


Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Warning: Missing asset in fonts for IranSans
Warning: Missing asset in fonts for IranSans
Warning: Missing asset in fonts for IranSans
Syncing files to device Android SDK built for x86...
W/Pushe   (20784): Too many initialize calls made, skipping reinitialization
I/System.out(20784): [Plugin] Trying to initialize Pushe
W/Pushe   (20784): Too many initialize calls made, skipping reinitialization
D/EGL_emulation(20784): eglMakeCurrent: 0xa2c043c0: ver 2 0 (tinfo 0xa2c03370)
E/Pushe   (20784): Obtaining FCM token failed: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784):  at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source:2)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.a.a(Unknown Source:21)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)
E/Pushe   (20784): Sending upstream message failed
E/Pushe   (20784): co.ronash.pushe.a: Cannot initialize Firebase Messaging with null Firebase App
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:38)
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:4)
E/Pushe   (20784):  at co.ronash.pushe.g.d.b(Unknown Source:106)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.f.a(Unknown Source:80)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)
E/Pushe   (20784): Obtaining FCM token failed: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784):  at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source:2)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.a.a(Unknown Source:21)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)
E/Pushe   (20784): Sending upstream message failed
E/Pushe   (20784): co.ronash.pushe.a: Cannot initialize Firebase Messaging with null Firebase App
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:38)
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:4)
E/Pushe   (20784):  at co.ronash.pushe.g.d.b(Unknown Source:106)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.f.a(Unknown Source:80)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)
I/zygote  (20784): Do partial code cache collection, code=30KB, data=23KB
I/zygote  (20784): After code cache collection, code=30KB, data=23KB
I/zygote  (20784): Increasing code cache capacity to 128KB
E/Pushe   (20784): Obtaining FCM token failed: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.google.firebase.FirebaseApp.get(java.lang.Class)' on a null object reference
E/Pushe   (20784):  at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source:2)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.a.a(Unknown Source:21)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)
E/Pushe   (20784): Sending upstream message failed
E/Pushe   (20784): co.ronash.pushe.a: Cannot initialize Firebase Messaging with null Firebase App
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:38)
E/Pushe   (20784):  at co.ronash.pushe.Pushe.a(Unknown Source:4)
E/Pushe   (20784):  at co.ronash.pushe.g.d.b(Unknown Source:106)
E/Pushe   (20784):  at co.ronash.pushe.task.tasks.f.a(Unknown Source:80)
E/Pushe   (20784):  at co.ronash.pushe.task.e.a(Unknown Source:87)
E/Pushe   (20784):  at co.ronash.pushe.task.b.a.a.onRunJob(Unknown Source:24)
E/Pushe   (20784):  at com.evernote.android.job.Job.runJob(Job.java:124)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:181)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:166)
E/Pushe   (20784):  at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149)
E/Pushe   (20784):  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/Pushe   (20784):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/Pushe   (20784):  at java.lang.Thread.run(Thread.java:764)```
mahdi-malv commented 5 years ago
سلام. طبق این ارور **فایربیس نتونسته مقداردهی** بشه. احتمالا بخاطر این می‌تونه باشه که یا لایبرری فایربیس اضافه‌نشده، یا **توکنی که قرار داده‌شده درست نیست.** _اگر کردنشیالی که موقع ساخت برنامه‌ توی کنسول مشخص کردید از کنسول فایربیس حذف بشه این مشکل پیش میاد._ لطفا توی کنسولتون اپ رو (در صورتی که نصب زیاد نداره) دوباره بسازید و کردنشیال جدید بهش بدید ( توی کنسول فایربیس اپ بسازید و اطلاعات رو از اونجا بردارید) **پ.ن:** منظور از کردنشیال **SenderId** و **ServerKey** هست که توی پروژه‌ی فایربیس دیده میشه.
imelyas commented 5 years ago
سلام من دوباره تست کردم این لاگ رو میده
Performing hot restart...
Syncing files to device Android SDK built for x86...
Restarted application in 2,270ms.
I/Pushe   ( 4114): Started Initializing Pushe. version: 1.6.3
W/GooglePlayServicesUtil( 4114): Google Play services out of date.  Requires 12451000 but found 10930470
I/System.out( 4114): [Plugin] Trying to initialize Pushe
W/Pushe   ( 4114): Too many initialize calls made, skipping reinitialization
W/GooglePlayServicesUtil( 4114): Google Play services out of date.  Requires 12451000 but found 10930470
I/Pushe   ( 4114): Trying to register to Pushe
W/GooglePlayServicesUtil( 4114): Google Play services out of date.  Requires 12451000 but found 10930470
روی ایمولاتور خود اندروید استودیو تست میکنم چون گوشی اندرویدی ندارم. گوگل پلی سرویس رو چطوری توی avd به روز کنم؟ توی کنسول پوشه اپ رو شناخت ولی یه نوتیف که فرستادم روی گوشی نیومد
mahdi-malv commented 5 years ago
سلام لطفا روی یه گوشی که گوگل‌پلی سرویسش آپدیته تست کنید ببینید واقعا مشکل حل شده؟ اگر واقعا ارور الان بخاطر گوگل‌پلی سرویس باشه از[ این لینک](https://support.google.com/googleplay/answer/9037938?hl=en) می‌تونید درباره‌ی آپدیتش بیشتر بخونید.
mahdi-malv commented 5 years ago

Feel free to reopen the issue if solutions are not helpful.

ParsaGachkar commented 5 years ago

لطفا بیشتر راهنمایی کنید، ٬ @elyasbeshkani این مشکل برای شما حل شد؟ میشه راه حلو با جزیات بیشتر برام توضیح بدین؟

imelyas commented 5 years ago

لطفا بیشتر راهنمایی کنید، ٬ @elyasbeshkani این مشکل برای شما حل شد؟ میشه راه حلو با جزیات بیشتر برام توضیح بدین؟

از نسخه 1.0.1 استفاده کردم