invalid service notification error while uploading image
See original GitHub issueI am trying to single image. But I get the following error
An uncaught Exception occurred on "main" thread.
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 groupKey=net.gotev vis=PRIVATE)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
This is the upload function:
displayImage(){
var documents = fs.knownFolders.temp();
documents.getEntities()
.then((entities)=>{
// entities is array with the document's files and folders.
entities.forEach((entity)=>{
console.log(entity);
console.log(entity.path);
let token = appSettings.getString("token");
console.log(token);
if (token != ''){
var request = {
url: url
method: "POST",
headers: {
"Content-Type": "application/octet-stream",
"File-Name": entity.path,
"Authorization": "Bearer " + token
},
description: "{ 'uploading': 'bigpig.jpg' }"
};
var task = session.uploadFile(entity.path, request);
task.on("progress", this.logEvent);
task.on("error", this.logEvent);
task.on("complete", this.logEvent);
}
});
}, function (error) {
// Failed to obtain folder's contents.
// globalConsole.error(error.message);
});
the entity path is " /data/user/0/org.testApp.testApp/cache/savedImage1510757546373.jpg". I tried to save the image to the temp folder of the emulator and find the file and upload to the server.
Could anyone tell me what is missing? and what this error means? Any help would be much appreciated. Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Android Gotev Upload Image Bad notification for ...
I've trying to check on gotev github, but I found kotlin tutorial only. how to use gotev image upload in my Upload.java or...
Read more >AdminApp: "Invalid file" error when uploading image
When a new image is uploaded, an error with message "Invalid file" is observed.
Read more >Error while uploading image in lightning community
I am trying to upload image in lighnint community and trying to change logo of community but i am getting error when i...
Read more >Invalid Object Error Message - Breeze Church Management
Please try to re-upload the image in jpeg format, assure that the image is in full-color, and right-side up. Also, assure that the...
Read more >Fix error messages with Uploaded ads - Google Ads Help
When uploading creatives in Google Ads, you may receive an error message. In most situations, the problem can be fixed by altering your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is still the case with version 3.2.1 when using
androidDisplayNotificationProgress: true
When setting this property to false, we get a different exception, namely:As far as I can see, this library in its newest version ALWAYS needs a notificationConfig, otherwise it will throw this exception.
We will stay on version 3.2.0 with notifications disabled, as this seems to be the only working way on Android Oreo.
@mariuspruski thx for your quick reply , updated all modules and still have the same error