I have an application that uses a native library (.so).
In the new version of the application I made changes in the lib. The problem is that after upgrading the application it looks like the new library is not loaded.
If I force stop the application and then I restarted it everything works fine.
In some cases just waiting for a while (for example 20 mins) fixes the problem.
Did anyone experience this issue?
Is there a way to fix it?
EDIT
I have also tried to call
System.loadLibrary("mylib.so");
in the onReceive of the OnUpgradeReceiver that is the broadcast receiver that is registered to be called when the application is upgraded
It did not help
EDIT2
I think this issue has to do with the fact that the lib uses the audio engine. The reason iwhy I think so is that I tried to change the name of the lib and it did not help either
Ok never mind I think the issue is just in my lib. I need to find where but I checked that the application is properly closed after the upgrading.
Related
I am new to Flutter. Can anyone post the link or code for "android foreground service example with a notification"? I googled but didn't get any good example of foreground service.
I'm working on a project that includes an SMS package. This App has to be active on the foreground.
Update:
I have created my own implementation of android foreground service for Flutter called android_long_task. check it out it solved my problem. let me know if it solves your problem by raising an issue.I created my own library because the tutorial I mentioned just shows how to create a foreground service in java and that's all and as you have found out by now the other foregorund_service plugins have some problems.
Old answer (didn't help me):
if you're having a problem with this and none of the libraries mentioned in other answers worked for you. you might wanna give this tutorial from RetroPortal Studio a try. it's a total of 26 minutes which teaches you how to write a working foreground service for flutter android
I tried flutter_foreground_service but it has a big problem. When app closes this plugin throwing error. This bug is reported in here: https://github.com/pauldemarco/foreground_service/issues/1
foreground_service has problem too: https://github.com/pauldemarco/foreground_service/issues/1
Probably there isn't a good solution for now (Jan 2020). If someone develops a good solution may be I add it to here.
I think Google should find solution for this kind of problems. We're using flutter becouse we're thinking that flutter is more effective. If we lost our time kind of this absurd errors why we using flutter? Using kotlin for android, swift for ios this is more good probably.
Pauldemarco has created some excellent flutter packages for flutter. He has developed one for Foreground service too. As of now, it is only supported in android. It is not supported for iOS. I hope this helps.
https://github.com/pauldemarco/foreground_service
You can use library flutter_foreground_task for long or always running task.
Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time
I've ran into a problem with apache cordova background modes. I need to make an application where my battery level is checked from time to time in the background (if the app is in background), and if it is below some level, then the app should notify you about it. Eventually I've managed to run it on android, with katzer's plugin, it does work indeed, but after a while it shuts down completely and on iOS it does not even work. I've tried other plugins but nothing was helpful. Can you please help me find the problem with this? Also it must work on wp8/8.1 that's why katzer's plugin suited me best. (Not to misunderstand me, it is an outstanding plugin, in fact the only that works).
Here is the code on Pastebin
Also I'm linking the plugin which I'm using at the moment
Thanks in advance
My project consists of a main project and two library projects. I am using the manifest merging. One of library projects has a service running in a separate process with intention that it gets used by other similar apps which include my framework.
I am experiencing a very strange behavior where even though I update code in the service part, my app is still using the previous old version of it. Reinstalling the app does not help either.
Does anyone know what is a cause of this problem and how to resolve it?
UPDATE: The problem occurs only if I use startService(new Intent ("service action"))
I just excavated a maybe 3 months old Phonegap (for Android) project from my archives. Since I always had little problems with the sound API (sounds playing twice or not stopping - the rest was working just fine) I thought it might be a good idea to update to the latest version of Phonegap / now Cordova, which currently is 1.9.0. Unfortunately the app now crashes on startup (telling me it was forced to stop unexpectedly in an alert box) in all devices that I can test on (virtual and real handsets).
I guess I might have forgotten something in the update process so I'll just list what I actually did during the update:
replaced the JAR file to 1.9.0
replaced the JS library to 1.9.0 (and replaced the reference in the index.html
Edited my AndroidManifest.xml to match this page
Replaced the plugins.xml content with the new version
Replaced the phonegap.xml in the resfolder by the new cordova.xml
changed the imports in the main AppActivity.java file
Updated the all the SDK packages in Eclipse
Somehow this doesn't seem to suffice.
Did I just miss something that still needs to be done or is this some problem with something that I am doing inside my app? I didn't use any Cordova API except for playing Sounds.
minSdkVersion is 8 by the way.
Ok, so what did the trick (kind of) for me was to create a new Project in Eclipse, set it up the exact same way and just incorporate my www folder into the new project.
The two projects look exactly the same but lord only knows that I probably have missed something. In case anyone still has input on this, don't hesitate to share it!