I/Choreographer(25376): Skipped 1 frames! The application may be doing too much work on its main thread.I/flutter (25376): Connected to OneDrive.I/flutter (25376): Attempting to upload CSV file to OneDrive...I/flutter (25376): Failed to upload CSV file to OneDrive.[AndroidInAppWebViewWidget] (android) AndroidInAppWebViewWidget ID 4 calling "dispose" using []D/Surface (25376): Surface::disconnect(this=0x73fa2be000,api=1)I/BufferQueueProducer(25376): [ImageReader-1456x720f1m3-25376-9](this:0x73ced80000,id:9,api:1,p:25376,c:25376) disconnect(P): api 1D/Surface (25376): Surface::connect(this=0x73f9e81000,api=1)D/mali_winsys(25376): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000I/GED (25376): ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 24, oppidx_max 24, oppidx_min 0I/BufferQueue(25376): [ImageReader-1456x720f1m3-25376-9](this:0x73ced80000,id:9,api:1,p:-1,c:-1) ~BufferQueueCoreI/Choreographer(25376): Skipped 2 frames! The application may be doing too much work on its main thread.2I/GED (25376): ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 24, oppidx_max 24, oppidx_min 0E/chromium(25376): [ERROR:aw_browser_terminator.cc(166)] Renderer process (29179) crash detected (code -1).
Here’s what I can see on the logs when I tried uploading files to OneDrive.
Future<void> _connectToOneDrive(BuildContext context) async {
final onedrive = OneDrive(
redirectURL: "https://login.live.com/oauth20_desktop.srf",
clientID: clientID,
);
final success = await onedrive.connect(context);
if (success) {
print("Connected to OneDrive.");
_uploadCsvToOneDrive(onedrive);
}
}
Future<void> _uploadCsvToOneDrive(OneDrive onedrive) async {
final csvData = convertToCsv(rows);
final data = Uint8List.fromList(utf8.encode(csvData));
try {
print('Attempting to upload CSV file to OneDrive...');
final success = await onedrive.push(data, "data.csv");
if (!success) {
print('Failed to upload CSV file to OneDrive.');
} else {
print('CSV file uploaded successfully.');
}
} catch (e, stackTrace) {
print('Error during upload: $e');
print('Stack trace: $stackTrace');
}
}
Here’s the functions I used in order to upload data to One Drive. I can connect to the OneDrive account as the logs stated but when it comes to uploading it fails to do so.
May I know the right way to do so?
The packages used are flutter_onedrive: ^1.4.0 and oauth_webauth: ^5.1.0.
Tristan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Push this:
final csvData = convertToCsv(rows);
final data = Uint8List.fromList(utf8.encode(csvData));
out to an Isolate. It’s probably seriously CPU heavy. You can do that simply with:
import 'dart:async';
final data = await Isolate.run(() {
final csvData = convertToCsv(rows);
return Uint8List.fromList(utf8.encode(csvData));
};
You’re already inside an async function, so the await won’t require editing.