react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

Android starts uploading and then nothing

Open zvitek opened this issue 1 year ago • 5 comments

Hi, have you encountered similar behavior on Android? I select a file to send for upload. I get back the promise and the uploadId. But that's all. No event with process is called anymore.

The problem is only on the Android side.

For API level 30, the problem described above occurs. For API level 34, the whole application crashes.

Thanks a lot!

react-native-background-upload: 6.6.0 react-native: 0.73.6

await new Promise((resolve, reject) => {
Upload.startUpload(options)
	.then((uploadId) => {
		console.log('Upload started', uploadId); // <-- called
		Upload.addListener('progress', uploadId, (data) => {
			setProgress(data.progress); // <-- no called
		});
		Upload.addListener('cancelled', uploadId, (data) => {
			reject(data); // <-- no called
		});
		Upload.addListener('error', uploadId, (data) => {
			reject(data.error); // <-- no called
		});
		Upload.addListener('completed', uploadId, (data) => {
			resolve(true); // <-- no called
		});
	})
	.catch(reject);
});

zvitek avatar May 21 '24 10:05 zvitek

Same problem. It is ok on ios, but nothing happened on android. No error. No log. Just nothing.

narychen avatar Jun 01 '24 02:06 narychen

Did you try setting breakpoints to debug the issue?

GunnarAK avatar Jul 04 '24 21:07 GunnarAK

Have got same problem.

In my case It is fixed by adding this to your ProGuard configuration (proguard-rules.pro) : -keep class net.gotev.uploadservice.** { *; }

It mentioned in README.md but not in title project page.

VBarzionov avatar Jul 24 '24 14:07 VBarzionov

@zvitek same problem, were you able to solve the issue?

aliyanlatif avatar Aug 29 '24 10:08 aliyanlatif

i updated the build.gradle file of the react native background upload package with the following changes mentioned in the URL and it worked

https://github.com/Vydia/react-native-background-upload/pull/347/commits/f9a29c5963039c6f53e350fe19d6e6fdf1d7b73a

aliyanlatif avatar Aug 29 '24 10:08 aliyanlatif