johnuberbacher / flutter_medical

Functioning Doctor/Healthcare Catalog App created using Dart with Flutter. Stores and loads data from Firebase Firestore DB.
MIT License
242 stars 85 forks source link

NoSuchMethodError After Creating Account #4

Open clearnetinc opened 3 years ago

clearnetinc commented 3 years ago

1stly thanks for this great work

I am getting a red screen after irunning the app. I am running it on a device and is shows a red screen with error:

NoSuchMethodError: The getter 'length' was called on null.

Receiver: null

Tried calling 'lenght'

See also: https://flutter.dev/docs/testing/errors

THE IDE DEBUGGER READS:


════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building:
The getter 'length' was called on null.
Receiver: null
Tried calling: length

When the exception was thrown, this was the stack
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      titleCase
package:flutter_medical/widgets.dart:396
#2      _HomeScreenState.userHeader
package:flutter_medical/routes/home.dart:175
#3      _HomeScreenState.loadUserInfo.<anonymous closure>
package:flutter_medical/routes/home.dart:116
#4      SliverChildBuilderDelegate.build
package:flutter/…/widgets/sliver.dart:449
...
════════════════════════════════════════════════════════════════════════════════
W/System  (10106): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(10106): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp

Also i note that there are no functions specified are they not required? And added to that the Database rules. any guidance on that?

erdometo commented 3 years ago

I think this problem is because of database. If you haven't created collections named "doctors" and "specialties", you got this error at the start. when it tries to list collections etc. and if your database empty, a few values gets null value and you get this error. We need sample db to resolve this.

Leekogram commented 3 years ago

Yeah i think @erdometo is right, please can @johnuberbacher share us the structure or image sample of this project's db

clearnetinc commented 3 years ago

@erdometo

I think this problem is because of database. If you haven't created collections named "doctors" and "specialties", you got this error at the start. when it tries to list collections etc. and if your database empty, a few values gets null value and you get this error. We need sample db to resolve this.

I had already created them. Now when i run i get the error. Sorry is been a while i had left it to work on some other project

On the device it throws a red screen with error:

NoSuchMethodError: The getter 'length' was called on null.
Receiver: null
Tried calling: length
See also: https://flutter.dev/docs/testing/errors

Debugger

Running "flutter pub get" in medmate...
Launching lib\main.dart on DRA LX5 in debug mode...
 lib\main.dart
Note: C:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.18.0+1\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.7.2\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.14.0+2\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
W/ConnectionTracker(20109): Exception thrown while unbinding
W/ConnectionTracker(20109): java.lang.IllegalArgumentException: Service not registered: lu@bf5166a
W/ConnectionTracker(20109):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1556)
W/ConnectionTracker(20109):     at android.app.ContextImpl.unbindService(ContextImpl.java:1642)
W/ConnectionTracker(20109):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:703)
W/ConnectionTracker(20109):     at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):1)
W/ConnectionTracker(20109):     at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):2)
W/ConnectionTracker(20109):     at lv.E(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):9)
W/ConnectionTracker(20109):     at lf.a(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):3)
W/ConnectionTracker(20109):     at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):3)
W/ConnectionTracker(20109):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
W/ConnectionTracker(20109):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(20109):     at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):5)
Connecting to VM Service at ws://127.0.0.1:61731/kmkpWCJ7t60=/ws
D/HWUIExtension(20109): createProgram 0x0000000800000000, binary 0x868e661f, length 10736, format 37168 within 802ns
D/HWUIExtension(20109): createProgram 0x0002000800000001, binary 0x868c1698, length 11759, format 37168 within 1150ns
I/zygote  (20109): Do partial code cache collection, code=61KB, data=60KB
I/zygote  (20109): After code cache collection, code=61KB, data=60KB
I/zygote  (20109): Increasing code cache capacity to 256KB
W/IInputConnectionWrapper(20109): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(20109): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(20109): getTextAfterCursor on inactive InputConnection
I/zygote  (20109): Do full code cache collection, code=125KB, data=111KB
I/zygote  (20109): After code cache collection, code=102KB, data=75KB
W/IInputConnectionWrapper(20109): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(20109): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(20109): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(20109): endBatchEdit on inactive InputConnection
W/System  (20109): Ignoring header X-Firebase-Locale because its value was null.
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): [OkHttp] sendRequest<<
W/System  (20109): Ignoring header X-Firebase-Locale because its value was null.
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): [OkHttp] sendRequest<<
D/FirebaseAuth(20109): Notifying id token listeners about user ( 7w3C1fdALLcksKrga51nawhIlPd2 ).
D/FirebaseAuth(20109): Notifying auth state listeners about user ( 7w3C1fdALLcksKrga51nawhIlPd2 ).
I/zygote  (20109): Do partial code cache collection, code=120KB, data=99KB
I/zygote  (20109): After code cache collection, code=120KB, data=99KB
I/zygote  (20109): Increasing code cache capacity to 512KB
W/DynamiteModule(20109): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(20109): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(20109): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/zygote  (20109): The ClassLoaderContext is a special shared library.
I/zygote  (20109): The ClassLoaderContext is a special shared library.
V/NativeCrypto(20109): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 288 native methods...
I/ProviderInstaller(20109): Installed default security provider GmsCore_OpenSSL
I/zygote  (20109): Background concurrent copying GC freed 15969(1104KB) AllocSpace objects, 8(352KB) LOS objects, 49% free, 2MB/4MB, paused 2.928ms total 198.541ms
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
E/flutter (20109): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The getter 'docs' was called on null.
E/flutter (20109): Receiver: null
E/flutter (20109): Tried calling: docs
E/flutter (20109): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (20109): #1      _HomeScreenState.paginateDoctors
 package:flutter_medical/routes/home.dart
E/flutter (20109): #2      _HomeScreenState.initState
 package:flutter_medical/routes/home.dart
E/flutter (20109): #3      StatefulElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #4      ComponentElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #5      Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #6      Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #7      SingleChildRenderObjectElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #8      Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #9      Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #10     ComponentElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #11     Element.rebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #12     ComponentElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #13     ComponentElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #14     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #15     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #16     SingleChildRenderObjectElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #17     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #18     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #19     SingleChildRenderObjectElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #20     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #21     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #22     ComponentElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #23     StatefulElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #24     Element.rebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #25     ComponentElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #26     StatefulElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #27     ComponentElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #28     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #29     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #30     SingleChildRenderObjectElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #31     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #32     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #33     SingleChildRenderObjectElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #34     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #35     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #36     ComponentElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #37     StatefulElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #38     Element.rebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #39     ComponentElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #40     StatefulElement._firstBuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #41     ComponentElement.mount
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #42     Element.inflateWidget
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #43     Element.updateChild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #44     ComponentElement.performRebuild
 package:flutter/…/widgets/framework.dart
E/flutter (20109): #45     Element.rebuild (package:flutter/
I/flutter (20109): Shared Preferences: users name: null
I/flutter (20109): Instance of 'QuerySnapshot'
I/flutter (20109): Instance of 'QuerySnapshot'
I/flutter (20109): pulling doctors without having loaded any more, Document Limit is:
I/flutter (20109): 3

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building:
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md


When the exception was thrown, this was the stack
#2      new NetworkImage
 package:flutter/…/painting/_network_image_io.dart
#3      new Image.network
 package:flutter/…/widgets/image.dart
#4      _HomeScreenState.specialtyCard
 package:flutter_medical/routes/home.dart
#5      _HomeScreenState.specialtyList.<anonymous closure>
 package:flutter_medical/routes/home.dart
#6      SliverChildBuilderDelegate.build
 package:flutter/…/widgets/sliver.dart
...
════════════════════════════════════════════════════════════════════════════════
I/flutter (20109): Instance of 'QuerySnapshot'

════════ Exception caught by widgets library ═══════════════════════════════════
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.
════════════════════════════════════════════════════════════════════════════════
Reloaded 9 of 996 libraries in 23,975ms.

════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building:
The getter 'length' was called on null.
Receiver: null
Tried calling: length

When the exception was thrown, this was the stack
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      titleCase
 package:flutter_medical/widgets.dart
#2      _HomeScreenState.userHeader
 package:flutter_medical/routes/home.dart
#3      _HomeScreenState.loadUserInfo.<anonymous closure>
 package:flutter_medical/routes/home.dart
#4      SliverChildBuilderDelegate.build
 package:flutter/…/widgets/sliver.dart
...
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.
════════════════════════════════════════════════════════════════════════════════
Reloaded 9 of 996 libraries in 4,616ms.
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp

════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building:
The getter 'length' was called on null.
Receiver: null
Tried calling: length

When the exception was thrown, this was the stack
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      titleCase
 package:flutter_medical/widgets.dart
#2      _HomeScreenState.userHeader
 package:flutter_medical/routes/home.dart
#3      _HomeScreenState.loadUserInfo.<anonymous closure>
 package:flutter_medical/routes/home.dart
#4      SliverChildBuilderDelegate.build
 package:flutter/…/widgets/sliver.dart
...
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'length' was called on null.
Receiver: null
Tried calling: length
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.
════════════════════════════════════════════════════════════════════════════════
Reloaded 9 of 996 libraries in 3,910ms.
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
D/Surface (20109): Surface::disconnect(this=0x841eb000,api=1)
D/Surface (20109): Surface::disconnect(this=0x841eb000,api=-1)
D/Surface (20109): Surface::connect(this=0x87eff000,api=1)
I/Choreographer(20109): Skipped 36 frames!  The application may be doing too much work on its main thread.
V/PhoneWindow(20109): DecorView setVisiblity: visibility = 0, Parent = ViewRoot{5376303 com.finde.medmate/com.finde.medmate.MainActivity,ident = 0}, this = DecorView@e0945bd[MainActivity]
W/ConnectionTracker(20109): Exception thrown while unbinding
W/ConnectionTracker(20109): java.lang.IllegalArgumentException: Service not registered: lu@bf5166a
W/ConnectionTracker(20109):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1556)
W/ConnectionTracker(20109):     at android.app.ContextImpl.unbindService(ContextImpl.java:1642)
W/ConnectionTracker(20109):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:703)
W/ConnectionTracker(20109):     at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):1)
W/ConnectionTracker(20109):     at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):2)
W/ConnectionTracker(20109):     at lv.E(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):9)
W/ConnectionTracker(20109):     at lf.a(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):3)
W/ConnectionTracker(20109):     at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):3)
W/ConnectionTracker(20109):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
W/ConnectionTracker(20109):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(20109):     at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204516128@20.45.16 (110306-0):5)
W/System  (20109): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(20109): e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
shmatoka commented 3 years ago

I tried this today but I receive the same error like everyone here, I think this is because db structure is missing and also when start app, app try to found image which is save in the db but because our is empty coming, error with

'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.

and another error for GlobalDrawer

NoSuchMethodError: The getter 'length' was called on null. Receiver: null Tried calling: length See also: https://flutter.dev/docs/testing/errors

clearnetinc commented 3 years ago

I wonder if @Johnuberbacher https://github.com/johnuberbacher will ever respond

On Fri, Jan 29, 2021 at 5:29 PM shmatoka notifications@github.com wrote:

I tried this today but I receive the same error like everyone here, I think this is because db structure is missing and also when start app, app try to found image which is save in the db but because our is empty coming, error with

'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.

and another error for GlobalDrawer

NoSuchMethodError: The getter 'length' was called on null. Receiver: null Tried calling: length See also: https://flutter.dev/docs/testing/errors

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johnuberbacher/flutter_medical/issues/4#issuecomment-769873117, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARDUTUF4QH5GLTI66OFFDN3S4LH4RANCNFSM4TVSYSSQ .