You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upload Error when I updated my android sdk platform from 28 to 29 #263
Please, provide the following version numbers that your issue occurs with:
CLI: (run tns --version to fetch it)
6.0.5
Cross-platform modules: (check the 'version' attribute in the node_modules/tns-core-modules/package.json file in your project)
6.5.1
Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
"tns-ios": {
"version": "5.3.1"
},
"tns-android": {
"version": "6.5.0"
}
Plugin(s): (look for the version numbers in the package.json file of your
project and paste your dependencies and devDependencies here)
"nativescript-background-http": "^4.2.1"
Please, tell us how to recreate the issue in as much detail as possible.
Describe the steps to reproduce it.
Upload keeps on error, but it was working when my android sdk platform is 28 but error after I updated it to 29.
changed the title [-]Upload Error and Redirect is not working (for iOS)[/-][+]Upload Error when I updated my android sdk platform from 28 to 29[/+]on May 14, 2020
I also have a same error. Code work in api level 28 and below fine but in api level 29 its shows upload error.
my code is:
context
.authorize()
.then(function() {
return context.present();
})
.then(function(selection) {
selection.forEach(function(selected) {
var file = selected.android;
var name = file.substr(file.lastIndexOf("/") + 1);
var fileExt=file.substr(file.lastIndexOf(".") + 1);
var session = bghttp.session("image-upload");
var request = {
url: "**************product/upload_gallery",
method: "POST",
headers: {
"Content-Type": "application/octet-stream",
"file_name":name,
"file_ext":fileExt,
"post":that.post_id
},
description: "Uploading " + name,
androidNotificationTitle: 'Uploading Product Image',
androidDisplayNotificationProgress:true
};
var task = session.uploadFile(file, request);
task.on("responded", (e) => {
let res=JSON.parse(e.data);
});
task.on("progress", (e) => {
that.isUploading=true;
});
task.on("complete", (e) => {
that.isUploading=false;
that.fetch_gallery(that.post_id);
});
});
}).catch(function (e) {
console.log(e);
});
Same error for me, no trouble using API level 28, but getting exactly the same error with 29. I get an error in upload notification tray too.
It seems that android is stopping the upload for some reason. I gave a look at 29 release note and breaking changes but nothing about permission on upload seems to be changed.
Does anybody found a workaround?
I think I found out why of this problem.
This plugin uses an android library that is targeted as follow: <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="28" />
So that's why of the error.
I saw that this library has new version targeting from 21 to 29
but I guess will not be easy to include it cause it's a new major release
i also experienced this issue, when targeting SDK 29 rather than 28
i found that adding android:requestLegacyExternalStorage="true" to the AndroidManifest.xml file solved the issue, and images are now able to be uploaded again
Activity
[-]Upload Error and Redirect is not working (for iOS)[/-][+]Upload Error when I updated my android sdk platform from 28 to 29[/+]semocodev commentedon May 14, 2020
It's seem likes authorization header is missing in your request.
RohanPhpDev commentedon May 16, 2020
I also have a same error. Code work in api level 28 and below fine but in api level 29 its shows upload error.
my code is:
context
.authorize()
.then(function() {
return context.present();
})
.then(function(selection) {
newbie10003 commentedon May 18, 2020
We already include authorization header but still not working
danieledivito commentedon Jun 6, 2020
Same error for me, no trouble using API level 28, but getting exactly the same error with 29. I get an error in upload notification tray too.
It seems that android is stopping the upload for some reason. I gave a look at 29 release note and breaking changes but nothing about permission on upload seems to be changed.
Does anybody found a workaround?
danieledivito commentedon Jun 8, 2020
I think I found out why of this problem.
This plugin uses an android library that is targeted as follow:
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="28" />So that's why of the error.
I saw that this library has new version targeting from 21 to 29
but I guess will not be easy to include it cause it's a new major release
EagleEye25 commentedon Aug 27, 2020
i also experienced this issue, when targeting SDK 29 rather than 28
i found that adding
android:requestLegacyExternalStorage="true"to theAndroidManifest.xmlfile solved the issue, and images are now able to be uploaded again