mdanics / fluttergram

A fully functional Instagram clone written in Flutter using Firebase / Firestore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App tries to getFeed on Create username screen

GustavoContreiras opened this issue · comments

Launching lib\main.dart on Android SDK built for x86 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
I/Choreographer(10225): Skipped 58 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
I/OpenGLRenderer(10225): Davey! duration=1129ms; Flags=1, IntendedVsync=5903630658033, Vsync=5904597324661, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=5904612846700, AnimationStart=5904612970400, PerformTraversalsStart=5904613040600, DrawStart=5904631954200, SyncQueued=5904634448400, SyncStart=5904639734000, IssueDrawCommandsStart=5904639997700, SwapBuffers=5904678395100, FrameCompleted=5904765129400, DequeueBufferDuration=39011000, QueueBufferDuration=1305000, 
I/eiras.wavechec(10225): Waiting for a blocking GC ProfileSaver
W/eiras.wavechec(10225): Unsupported class loader
I/eiras.wavechec(10225): Background concurrent copying GC freed 7320(609KB) AllocSpace objects, 14(600KB) LOS objects, 49% free, 1622KB/3MB, paused 1.430ms total 642.595ms
I/DynamiteModule(10225): Considering local module com.google.android.gms.flags:3 and remote module com.google.android.gms.flags:3
I/DynamiteModule(10225): Selected local version of com.google.android.gms.flags
I/eiras.wavechec(10225): WaitForGcToComplete blocked ProfileSaver on HeapTrim for 375.814ms
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
I/chatty  (10225): uid=10124(com.gcontreiras.wavecheck) FirestoreWorker identical 1 line
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryDirectories:Ljava/util/List; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->systemNativeLibraryDirectories:Ljava/util/List; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryPathElements:[Ldalvik/system/DexPathList$NativeLibraryElement; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/DexPathList;->makePathElements(Ljava/util/List;)[Ldalvik/system/DexPathList$NativeLibraryElement; (light greylist, reflection)
V/NativeCrypto(10225): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 284 native methods...
W/eiras.wavechec(10225): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
D/NetworkSecurityConfig(10225): No Network Security Config specified, using platform default
W/eiras.wavechec(10225): Accessing hidden field Ljavax/net/ssl/SSLSocketFactory;->defaultSocketFactory:Ljavax/net/ssl/SSLSocketFactory; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ljavax/net/ssl/SSLServerSocketFactory;->defaultServerSocketFactory:Ljavax/net/ssl/SSLServerSocketFactory; (light greylist, reflection)
I/ProviderInstaller(10225): Installed default security provider GmsCore_OpenSSL
I/flutter (10225): [_setUpNotifications] START
I/flutter (10225): [_setUpNotifications] DONE
D/        (10225): HostConnection::get() New Host Connection established 0xec55be40, tid 10261
D/EGL_emulation(10225): eglMakeCurrent: 0xf1044d20: ver 2 0 (tinfo 0xed0513d0)
W/eiras.wavechec(10225): JNI critical lock held for 17.690ms on Thread[17,tid=10250,Runnable,Thread*=0xf0fc9400,peer=0x18d07f20,"GoogleApiHandler"]
I/flutter (10225): [_ensureLoggedIn] START
I/flutter (10225): [_ensureLoggedIn] user == null
I/flutter (10225): [_ensureLoggedIn] [signInSilently] START
I/flutter (10225): [_ensureLoggedIn] [signInSilently] DONE
I/flutter (10225): [_ensureLoggedIn] user == null
I/flutter (10225): [_ensureLoggedIn] [signIn] START
W/ActivityThread(10225): handleWindowVisibility: no activity for token android.os.BinderProxy@8e6ecf9
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
I/flutter (10225): [tryCreateUserRecord] user != null
I/flutter (10225): [_ensureLoggedIn] [signIn] DONE
I/flutter (10225): [tryCreateUserRecord] user != null
I/flutter (10225): [_ensureLoggedIn] auth.currentUser() == null
I/flutter (10225): [_ensureLoggedIn] [googleSignIn.currentUser.authentication] START
I/eiras.wavechec(10225): Background concurrent copying GC freed 21496(1004KB) AllocSpace objects, 10(520KB) LOS objects, 49% free, 2MB/4MB, paused 1.133ms total 213.295ms
W/eiras.wavechec(10225): Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/flutter (10225): [_ensureLoggedIn] [googleSignIn.currentUser.authentication] DONE
I/flutter (10225): [_ensureLoggedIn] [signInWithGoogle] START
W/BiChannelGoogleApi(10225): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@26ced49
I/flutter (10225): [_getFeed] START
I/flutter (10225): [_getFeed] [SharedPreferences.getInstance] START
I/flutter (10225): [_getFeed] [SharedPreferences.getInstance] DONE
I/flutter (10225): [_getFeed] [httpClient.getUrl] START
W/BiChannelGoogleApi(10225): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@26ced49
W/eiras.wavechec(10225): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ljava/net/InetAddress;->isNumeric(Ljava/lang/String;)Z (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (light greylist, JNI)
W/eiras.wavechec(10225): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (light greylist, linking)
I/flutter (10225): [_getFeed] [httpClient.getUrl] DONE
I/flutter (10225): [_getFeed] [request.close] START
I/flutter (10225): [_getFeed] [request.close] DONE
I/flutter (10225): [_getFeed] result: [ERROR] [_getFeed] Getting a feed >> Http status 500
D/FirebaseAuth(10225): Notifying id token listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseAuth(10225): Notifying auth state listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseApp(10225): Notifying auth state listeners.
D/FirebaseApp(10225): Notified 0 auth state listeners.
I/flutter (10225): [_ensureLoggedIn] [signInWithGoogle] DONE
I/flutter (10225): [_ensureLoggedIn] DONE
D/FirebaseAuth(10225): Notifying id token listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseApp(10225): Notifying auth state listeners.
D/FirebaseApp(10225): Notified 0 auth state listeners.

I've put some prints all around the code to understand how things were working and found some issues, this is one of them.

You can see in the end that the result return a http status 500.

        if (response.statusCode == HttpStatus.ok) {
        print('[_getFeed] response.statusCode == HttpStatus.ok');

        print('[_getFeed] [response.transform.join] START');
        String json = await response.transform(utf8.decoder).join();
        print('[_getFeed] [response.transform.join] DONE');

        prefs.setString("feed", json);
        List<Map<String, dynamic>> data = jsonDecode(json).cast<Map<String, dynamic>>();

        print('[_getFeed] [_generateFeed] START');
        listOfPosts = _generateFeed(data);
        print('[_getFeed] [_generateFeed] DONE');

      } 
      
      else {
        result = '[ERROR] [_getFeed] Getting a feed >> Http status ${response.statusCode}';
      }