Getting error on application start in WebServer 8 Beta : java.lang.ArrayIndexOutOfBoundsException - websphere-8

I'm see the following error. Does anyone know the cause?
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R java.lang.ArrayIndexOutOfBoundsException
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.objectweb.asm.ClassReader.readUTF8(Unknown Source)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.objectweb.asm.ClassReader.a(Unknown Source)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.objectweb.asm.ClassReader.accept(Unknown Source)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.objectweb.asm.ClassReader.accept(Unknown Source)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.EJBModuleLocator.locateAnnotations(EJBModuleLocator.java:244)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ModuleLocator.classContainsAnnotations(ModuleLocator.java:83)
[8/1/15 13:23:02:926 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.EJBModuleLocator.jarArchiveContainsAnnotations(EJBModuleLocator.java:151)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.EJBModuleLocator.isEJBModule(EJBModuleLocator.java:90)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.EjbJar30NoDDImportStrategyImpl$EjbJar30NoDDDiscriminator.hasContent(EjbJar30NoDDImportStrategyImpl.java:186)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.EjbJar30NoDDImportStrategyImpl$EjbJar30NoDDDiscriminator.canImport(EjbJar30NoDDImportStrategyImpl.java:97)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openArchive(ArchiveTypeDiscriminatorImpl.java:213)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openUsingChild(ArchiveTypeDiscriminatorImpl.java:250)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openArchive(ArchiveTypeDiscriminatorImpl.java:207)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openUsingChild(ArchiveTypeDiscriminatorImpl.java:250)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openArchive(ArchiveTypeDiscriminatorImpl.java:207)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.RootArchiveTypeDescriminatorImpl.openArchive(RootArchiveTypeDescriminatorImpl.java:86)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.openSpecificArchive(ArchiveTypeDiscriminatorImpl.java:433)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.fullOpenArchive(ArchiveTypeDiscriminatorImpl.java:411)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.openArchive(CommonarchiveFactoryImpl.java:1426)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.openNestedArchive(CommonarchiveFactoryImpl.java:687)
[8/1/15 13:23:02:927 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.openNestedArchive(ArchiveImpl.java:1955)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.openNestedArchive(EARFileImpl.java:1262)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl.openNestedArchive(LoadStrategyImpl.java:1051)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl.collectFilesFromLooseArchives(LoadStrategyImpl.java:721)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl.collectFiles(LoadStrategyImpl.java:667)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl.getFiles(ContainerImpl.java:470)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.getFiles(EARFileImpl.java:2498)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.getModuleFiles(EARFileImpl.java:1074)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at com.ibm.ws.management.application.client.AppInstallHelper.checkForXmiFiles(AppInstallHelper.java:1219)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at com.ibm.ws.management.application.client.AppInstallHelper.checkForEE5Restrictions(AppInstallHelper.java:407)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at com.ibm.ws.management.application.task.ValidateEE5RestrictionTask.performTask(ValidateEE5RestrictionTask.java:126)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:312)
[8/1/15 13:23:02:928 IST] 00000018 SystemErr R at java.lang.Thread.run(Thread.java:736)

This looks the same as the problem solved by PM63189.

Related

Firebase Auth Causes Gradle to Fail

I am trying to add Firebase Auth to my flutter project but when I do I get the following error:
Finished with error: Gradle task assembleDebug failed with exit code 1
All I am doing is adding the following to my pubspec.yaml file:
firebase_auth: ^0.14.0+9
I have posted this on the Github page and got nothing so I am guessing its a unique error. There is not much feedback to the failure so its hard to debug. I have been trying to figure it out for a couple of days.
Any help is appreciated!
[ +231 ms] [ +362 ms] Building bundle
[ ] [ +1 ms] Writing asset files to C:\Users\jonathan.king\App Dev\oto_app_0\build\app\intermediates\flutter\debug\android-x86/flutter_assets
[ +200 ms] [ +201 ms] Wrote C:\Users\jonathan.king\App Dev\oto_app_0\build\app\intermediates\flutter\debug\android-x86/flutter_assets
[ ] [ +6 ms] "flutter bundle" took 6,855ms.
[ +398 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ +199 ms] > Task :app:checkDebugClasspath UP-TO-DATE
[ ] > Task :app:preBuild UP-TO-DATE
[ ] > Task :firebase_auth:preBuild UP-TO-DATE
[ ] > Task :firebase_auth:preDebugBuild UP-TO-DATE
[ ] > Task :firebase_auth:checkDebugManifest UP-TO-DATE
[ ] > Task :firebase_auth:processDebugManifest UP-TO-DATE
[ ] > Task :firebase_core:preBuild UP-TO-DATE
[ ] > Task :firebase_core:preDebugBuild UP-TO-DATE
[ +1 ms] > Task :firebase_core:checkDebugManifest UP-TO-DATE
[ ] > Task :firebase_core:processDebugManifest UP-TO-DATE
[ ] > Task :flutter_ble:preBuild UP-TO-DATE
[ ] > Task :flutter_ble:preDebugBuild UP-TO-DATE
[ ] > Task :flutter_ble:checkDebugManifest UP-TO-DATE
[ ] > Task :flutter_ble:processDebugManifest UP-TO-DATE
[ ] > Task :app:preDebugBuild FAILED
[ ] 10 actionable tasks: 2 executed, 8 up-to-date
[ +743 ms] Running Gradle task 'assembleDebug'... (completed in 13.2s)
[ +2 ms] "flutter run" took 19,860ms.
Gradle task assembleDebug failed with exit code 1
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:751:5)
<asynchronous suspension>
#2 buildGradleProject (package:flutter_tools/src/android/gradle.dart:494:14)
<asynchronous suspension>
#3 buildApk (package:flutter_tools/src/android/apk.dart:34:9)
<asynchronous suspension>
#4 AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:486:13)
<asynchronous suspension>
#5 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:378:54)
<asynchronous suspension>
#6 HotRunner.run (package:flutter_tools/src/run_hot.dart:254:39)
<asynchronous suspension>
#7 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:472:37)
<asynchronous suspension>
#8 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#9 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#10 _rootRunUnary (dart:async/zone.dart:1132:38)
#11 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#13 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#14 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#15 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#16 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#17 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#18 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#19 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#20 _rootRunUnary (dart:async/zone.dart:1132:38)
#21 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#23 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#24 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#25 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#26 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#27 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#28 AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
#29 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#30 _rootRunUnary (dart:async/zone.dart:1132:38)
#31 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#32 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#33 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#34 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#35 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#36 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#37 _rootRun (dart:async/zone.dart:1124:13)
#38 _CustomZone.run (dart:async/zone.dart:1021:19)
#39 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#40 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#41 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#42 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#43 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#44 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
I solved this by restarting my flutter project in Android Studio. I made sure not to use Kotlin and then I followed the firebase tutorial again (https://firebase.google.com/docs/flutter/setup). I had to add the following code to my gradle.properties however:
android.useAndroidX=true
android.enableJetifier=true
Seems to work fine now
try using old firebase_auth plugin
Yes gradle is sick. A poor joke. The issue will be some version of something does not like some other version. The error messages are meaningless and pointless to try and understand.
If you get a gradle problem the only way to sort it out is to create a new project and copy your dart etc files across. And reset-up Firebase etc. Yes this can waste a few hours but quicker and more reliable than trying to find the gradle problem.

Permission denied when reading from database

I have a problem reading data from a firebase database.
The code below belongs to a function attached to a [FlatButton]:
void newEntry(){
print(_database.reference().child('todo').equalTo('Dan').once().then((value){
print(value.key);
}));
}
Whenever I run this piece of code I get this error:
I/flutter (29847): Instance of 'Future<dynamic>'
D/NetworkSecurityConfig(29847): No Network Security Config specified, using platform default
W/SyncTree(29847): Listen at /todo failed: DatabaseError: Permission denied
E/flutter (29847): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Instance of 'DatabaseError'
E/flutter (29847): #0 Query.once (package:firebase_database/src/query.dart:90:41)
E/flutter (29847): <asynchronous suspension>
E/flutter (29847): #1 _MyAppState.newEntry (package:database_project/main.dart:94:62)
E/flutter (29847): #2 _MyAppState._buildButton.<anonymous closure> (package:database_project/main.dart:88:9)
E/flutter (29847): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter (29847): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:566:30)
E/flutter (29847): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter (29847): #6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter (29847): #7 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:177:9)
E/flutter (29847): #8 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:436:9)
E/flutter (29847): #9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter (29847): #10 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter (29847): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:221:19)
E/flutter (29847): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)chEvent (package:flutter/src/gestures/binding.dart:199:22) ePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (29847): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)ePointerEvent (package:flutter/src/gestures/binding.dart:156:7) ePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (29847): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (29847): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (29847): #16 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (29847): #17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (29847): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7) ity]
E/flutter (29847): #19 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter (29847): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5) w{8084b2a VFE...... .F...... 0,0-1440,2872} of ViewRootImpl#b8c6359[MainActivity]
E/flutter (29847): t/com.example.database_project.MainActivity#8084b2a#0[29847])/#0xeeafd1b io.flutter.view.FlutterView{8084b2a VFE.D/ViewRootImpl#b8c6359[MainActivity](29847): MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(29847): prepareNavigationBarInfo() DecorView#48d0f7a[MainActivew{8084b2a VFE...... .F...... 0,0-1440,2872}ity]
D/InputMethodManager(29847): getNavigationBarColor() -855310D/SurfaceView(29847): onWindowVisibilityChanged(8) false io.flutter.view.FlutterView{8084b2a VFE...... .F...... 0,0-1440,2872} of ViewRootImpl#b8c6359[MainActivity]D/SurfaceView(29847): show() Surface(name=SurfaceView - com.example.database_project/com.example.database_project.MainActivity#8084b2a#0[29847])/#0xeeafd1b io.flutter.view.FlutterView{8084b2a VFE...... .F...... 0,0-1440,2872}D/SurfaceView(29847): surfaceDestroyed callback.size 1 #2 io.flutter.view.FlutterView{8084b2a VFE...... .F...... 0,0-1440,2872}W/libEGL (29847): EGLNativeWindowType 0x7af3edd010 disconnect failed
D/SurfaceView(29847): destroy() Surface(name=SurfaceView - com.example.database_project/com.example.database_project.MainActivity#8084b2a#0[29847])/#0xeeafd1b io.flutter.view.FlutterView{8084b2a VFE...... .F...... 0,0-1440,2872}W/libEGL (29847): EGLNativeWindowType 0x7b02e2a010 disconnect failedD/OpenGLRenderer(29847): eglDestroySurface = 0x7af3f13680, 0x7b02e2a000D/ViewRootImpl#b8c6359[MainActivity](29847): Relayout returned: old=[0,0][1440,3040] new=[0,0][1440,3040] result=0x5 surface={valid=false 0} changed=trueD/ViewRootImpl#b8c6359[MainActivity](29847): setWindowStopped(true) old=false
D/SurfaceView(29847): windowStopped(true) false io.flutter.view.FlutterView{8084b2a VFE...... .F...... 0,0-1440,2872} of ViewRootImpl#b8c6359[MainActivity]
D/ViewRootImpl#b8c6359[MainActivity](29847): Surface release. android.view.WindowManagerGlobal.setStoppedState:669 android.app.Activity.performStop:7647 android.app.ActivityThread.callActivityOnStop:4372 android.app.ActivityThread.performStopActivityInner:4350 android.app.ActivityThread.handleStopActivity:4425 android.app.servertransaction.StopActivityItem.execute:41 android.app.servertransaction.TransactionExecutor.executeLifecycleState:145 android.app.servertransaction.TransactionExecutor.execute:70
D/InputTransport(29847): Input channel destroyed: fd=100
I/FirebaseAuth(29847): [FirebaseAuth:] Loading module via FirebaseOptions.I/FirebaseAuth(29847): [FirebaseAuth:] Preparing to create service connection to gms implementation
As for the path of the database is todo/userId/Dan Database.
EDIT: Forgot to mention that I updated my security rules as following:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
EDIT
As per #Andrey Ilyunin comment I've authenticated my application to an user and applied the same security rules. I still get the same exception, i.e:
D/NetworkSecurityConfig( 4123): No Network Security Config specified, using platform default
W/SyncTree( 4123): Listen at /todo failed: DatabaseError: Permission denied
E/flutter ( 4123): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Instance of 'DatabaseError'
E/flutter ( 4123): null
E/flutter ( 4123): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Instance of 'DatabaseError'
E/flutter ( 4123): null

How can access the second document in a Firebase Firestore collection in Flutter?

I have a collection named "wallpapers" on my firebase firestore, where each document in my collection has three entries among which one is named 'url'. How can I access the 'url' section of the second document in flutter? Here's what I am trying to do:
String header_url;
Firestore.instance.collection('wallpapers').getDocuments().then((document) {
header_url = document.documents.elementAt(1).data['url'];
});
NetworkImage header = NetworkImage(header_url);
And here's what I get in my logs:
Launching lib\main.dart on QMobile Z10 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
E/flutter (19630): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: 'package:flutter/src/painting/image_provider.dart': Failed assertion: line 486 pos 14: 'url != null': is not true.
E/flutter (19630): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:40:39)
E/flutter (19630): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter (19630): #2 new NetworkImage (package:flutter/src/painting/image_provider.dart:486:14)
E/flutter (19630): #3 main (package:querencia/main.dart:13:25)
E/flutter (19630): #4 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:199:25)
E/flutter (19630): #5 _rootRun (dart:async/zone.dart:1124:13)
E/flutter (19630): #6 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (19630): #7 _runZoned (dart:async/zone.dart:1516:10)
E/flutter (19630): #8 runZoned (dart:async/zone.dart:1500:12)
E/flutter (19630): #9 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:190:5)
E/flutter (19630): #10 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:19)
E/flutter (19630): #11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
E/flutter (19630):
Syncing files to device QMobile Z10...
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
V/InputMethodManager(19630): START INPUT: io.flutter.view.FlutterView{85d34b5 VFE..... .F...... 0,0-1080,1776} ic=null tba=android.view.inputmethod.EditorInfo#3723d594 controlFlags=#100
D/ActivityThread(19630): ACT-AM_ON_PAUSE_CALLED ActivityRecord{136c51 token=android.os.BinderProxy#aebfcb6 {com.technoscans.querencia/com.technoscans.querencia.MainActivity}}
D/ActivityThread(19630): ACT-PAUSE_ACTIVITY handled : 0 / android.os.BinderProxy#aebfcb6
V/ActivityThread(19630): Finishing stop of ActivityRecord{136c51 token=android.os.BinderProxy#aebfcb6 {com.technoscans.querencia/com.technoscans.querencia.MainActivity}}: show=true win=com.android.internal.policy.impl.PhoneWindow#3d76d983
D/ActivityThread(19630): ACT-STOP_ACTIVITY_SHOW handled : 0 / android.os.BinderProxy#aebfcb6
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
D/SQLiteDatabase(19630): beginTransaction()
D/SQLiteDatabase(19630): endTransaction()
V/InputMethodManager(19630): START INPUT: io.flutter.view.FlutterView{85d34b5 VFE..... .F...... 0,0-1080,1776} ic=null tba=android.view.inputmethod.EditorInfo#2c8c432c controlFlags=#100
V/InputMethodManager(19630): START INPUT: io.flutter.view.FlutterView{85d34b5 VFE..... .F...... 0,0-1080,1776} ic=null tba=android.view.inputmethod.EditorInfo#143831f5 controlFlags=#100
I/System.out(19630): [CDS]close[56739]
I/System.out(19630): [CDS][DNS] getAllByNameImpl netId = 0
D/libc-netbsd(19630): [getaddrinfo]: hostname=firestore.googleapis.com; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd(19630): [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0
D/libc-netbsd(19630): [getaddrinfo]: hostname=firestore.googleapis.com; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd(19630): [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd(19630): getaddrinfo: firestore.googleapis.com get result from proxy >>
I/System.out(19630): propertyValue:true

error when using https with flutter http.dart package

i am usin http.dart package to make http post for login, everything is work good when my restful api in localhost and with (http protocol), but when upload my backend api to shared host with (https protocol):
I/flutter (12071): HandshakeException: Handshake error in client (OS Error:
I/flutter (12071): CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:363))
this is my code for http request:
final res = await http
.post(Uri.encodeFull(url),
body: {"email": _user.text, "password": _pass.text},
headers: {'Accept' : 'application/json'});
this is all debug message:
E/flutter (12071): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (12071): HandshakeException: Handshake error in client (OS Error:
E/flutter (12071): CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:363))
E/flutter (12071): #0 IOClient.send (package:http/src/io_client.dart:33:23)
E/flutter (12071): <asynchronous suspension>
E/flutter (12071): #1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:169:38)
E/flutter (12071): <asynchronous suspension>
E/flutter (12071): #2 BaseClient.post (package:http/src/base_client.dart:54:7)
E/flutter (12071): #3 post.<anonymous closure> (package:http/http.dart:70:16)
E/flutter (12071): #4 _withClient (package:http/http.dart:166:20)
E/flutter (12071): <asynchronous suspension>
E/flutter (12071): #5 post (package:http/http.dart:69:5)
E/flutter (12071): #6 LoginState._login (package:mis/auth/login.dart:41:23)
E/flutter (12071): <asynchronous suspension>
E/flutter (12071): #7 LoginState.build.<anonymous closure> (package:mis/auth/login.dart:216:31)
E/flutter (12071): #8 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
E/flutter (12071): #9 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
E/flutter (12071): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter (12071): #11 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
E/flutter (12071): #12 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
E/flutter (12071): #13 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (12071): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:184:20)
E/flutter (12071): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
E/flutter (12071): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
E/flutter (12071): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
E/flutter (12071): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
E/flutter (12071): #19 _invoke1 (dart:ui/hooks.dart:168:13)
E/flutter (12071): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)
According to https://github.com/flutter/flutter/issues/27883
Just add
<uses-permission android:name="android.permission.INTERNET" />
in your app's android/app/src/main/AndroidManifest.xml
add <uses-permission android:name="android.permission.INTERNET"/>
in your app's android/app/src/main/AndroidManifest.xml file
and make sure your device has internet connection.

Downloading image to file from firebase in flutter

I am trying to store images from firebase storage to the phone so that they can be available offline (downloaded). I am aware of this Stack Overflow question Download an image from Firebase to Flutter
-- but that solution seems outdated as the "getData()" method now requires a maxSize-- (I just pick a high number like 9999999).
My current attempt looks like this. My thought process is that by downloading the data, I can then write it to a local file. I am using the path_provider pub.
static Future<List<int>> downloadImage(String title, String route) async{
List<int> data = await FirebaseStorage.instance.ref().child("English/routes/" + route + "/" + title +".jpg").getData(1000000);
var text = new String.fromCharCodes(data);
print("data= "+data.toString());
print("text= " +text);
return data;
}
Future<String> get _localPath async {
final directory = await getApplicationDocumentsDirectory();
return directory.path;
}
Future<File> localFile(String fileName) async {
final path = await _localPath;
return new File('$path/'+fileName+'.txt');
}
Future<File> writeImage(List<int> bytes, File file) async {
// Write the file
return file.writeAsBytes(bytes);
}
When I run downloadImage, I get the following errors over and over again, overflowing my console.
I can't tell whether the error is due to authentication, because of the following error message
(E/StorageUtil(15931): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.)
Or maybe something to do with the "maxSize", because of this error message
java.lang.IndexOutOfBoundsException: the maximum allowed buffer size was exceeded.
Or maybe both! But my rules are set to true for reading and writing so I don't even see how authentication has anything to do with it. I've not had to sign in before.
E/StorageException(15931): StorageException has occurred.
E/StorageException(15931): An unknown error occurred, please check the HTTP result code and inner exception for server response.
E/StorageException(15931): Code: -13000 HttpResult: 200
E/StorageException(15931): the maximum allowed buffer size was exceeded.
E/StorageException(15931): java.lang.IndexOutOfBoundsException: the maximum allowed buffer size was exceeded.
E/StorageException(15931): at com.google.firebase.storage.zzi.doInBackground(Unknown Source)
E/StorageException(15931): at com.google.firebase.storage.StreamDownloadTask.run(Unknown Source)
E/StorageException(15931): at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
E/StorageException(15931): at com.google.firebase.storage.zzq.run(Unknown Source)
E/StorageException(15931): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/StorageException(15931): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/StorageException(15931): at java.lang.Thread.run(Thread.java:762)
E/StorageUtil(15931): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
E/flutter (15931): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (15931): PlatformException(download_error, An unknown error occurred, please check the HTTP result code and inner exception for server response., null)
E/flutter (15931): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:547:7)
E/flutter (15931): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
E/flutter (15931): <asynchronous suspension>
E/flutter (15931): #2 StorageReference.getData (package:firebase_storage/firebase_storage.dart:207:42)
E/flutter (15931): <asynchronous suspension>
E/flutter (15931): #3 Utils.downloadImage (package:flutter_alight/utils/utils.dart:88:108)
E/flutter (15931): <asynchronous suspension>
E/flutter (15931): #4 BusRouteItemState.downloadPois.<anonymous closure> (package:flutter_alight/UI/busRouteCards.dart:56:23)
E/flutter (15931): #5 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
E/flutter (15931): #6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330:11)
E/flutter (15931): #7 _DelayedData.perform (dart:async/stream_impl.dart:578:14)
E/flutter (15931): #8 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:694:11)
E/flutter (15931): #9 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:654:7)
E/flutter (15931): #10 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter (15931): #11 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
W/NetworkRequest(15931): no auth token for request
I/System.out(15931): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(15931): (HTTPLog)-Static: isSBSettingEnabled false
E/StorageReference(15931): the maximum allowed buffer size was exceeded.
W/StreamDownloadTask(15931): Exception occurred calling doInBackground.
W/StreamDownloadTask(15931): java.lang.IndexOutOfBoundsException: the maximum allowed buffer size was exceeded.
Maybe the high number you picked isn't high enough for what you want to download.
1mb is 1024*1024 = 1048576, which is higher than what you set as max limit.
And your data could be larger than 1mb.
Check your data and set the max limit accordingly.

Resources