Comments (11)
?
from bgs-core.
Sorry, I hadn't noticed your issue.
I'll have to have a dig through the code, but the most obvious thing would be to add some logging to the register function (within BackgroundService.java) if there isn't already any in there. Then add additional logging to the Boot Receiver.
from bgs-core.
Had a quick look at the code;
Within BootReceiver.java add some Log.d statements to show if the onReceive method is actually hit.
Potentially worth also adding Log.d statements to the PropertyHelper.java in getBootServices, addBootService and isBootService. These methods are responsible for saving & retrieving if it should shouldn't start on boot.
Then use the log cat to check firstly that the boot start is being set, then secondly that the BootReceiver is called when the device starts and then that is attempts to start the service.
from bgs-core.
Thank you,
I will add these logs and call you back with the result.
I am new to phonegap, how do I get the logs generated by code. Java?
from bgs-core.
Ok - that is a steep learning curve. You need to learn how to develop Android application using Eclipse & Java.
I'd suggest learning these things (searches on google will prove better than me trying to explain them) - assuming you haven;t already:
- Install Android Developer kit
- Install Eclipse
- Find tutorial to build an Android native app using Eclipse
- Practice running your native app within the Android emulator
- Learn how to attach the "logcat" window in Eclipse to the Android emulator. The logcat screen will display all the log messages from the emulator (or connected physical device if you do correctly).
- Look up Log.d java command which will write a debug message to the logcat window.
- Learn how to use the filtering within the logcat window to just see your app
Once happy with the above, then come back to your phonegap application and use the skills you've learnt to use the logcat to diagnose the problem within your app. You may see a warning or an error in the logcat if you javascript is badly formed. If not, then you'll want to look for the debug messages (my code is fairly saturated with Log.d statements).
If still getting stuck, then post up the locat results.
from bgs-core.
Hi,
see who is giving the error.
Please can you help me?
java.lang.RuntimeException: Unable to instantiate service com.red_folder.phonegap.plugin.backgroundservice.RastreadorService: java.lang.ClassNotFoundException: Didn't find class "com.red_folder.phonegap.plugin.backgroundservice.RastreadorService" on path: DexPathList[[zip file "/data/app/tmz.rastreador-2.apk"],nativeLibraryDirectories=[/data/app-lib/tmz.rastreador-2, /vendor/lib, /system/lib]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2559)
at android.app.ActivityThread.access$1800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:615)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.red_folder.phonegap.plugin.backgroundservice.RastreadorService" on path: DexPathList[[zip file "/data/app/tmz.rastreador-2.apk"],nativeLibraryDirectories=[/data/app-lib/tmz.rastreador-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2556)
from bgs-core.
It can't find the service name properly. Is it named correctly?
It this error occurring on boot.
from bgs-core.
from bgs-core.
This application I had first developed in java and eclipse, but then switched to html5. Ellipse in the logcat I've used without problems. I just did not know how to use logcat with phonegap. I just saw on google that I could run a "monitor" command and it will open the Android Debug Monitor
But thanks for your step by step
=)
ps.: Sorry, my english is not very good!
from bgs-core.
Sorry for the delay;
There is a difference in your package name at the top iof RastreaderService.java. Within the file it reads:
com.red_folder.phonegap.plugin.backgroundservice.services
Yet your folder structure and the error in the logcat seems to be expect it to be:
com.red_folder.phonegap.plugin.backgroundservice
Basically, remove the ".services" from your package name
from bgs-core.
No response since June - assumed closed
from bgs-core.
Related Issues (20)
- Error Occurs on startService(success,failed) ;
- Backgound service stops when the app is terminated HOT 2
- creating multiple service class HOT 2
- Does this plugin works with local notifications? HOT 2
- Integrating with NotificationListenerService would it work?
- If Background Service is Running Through Any Local Notification or Alerts?
- Where to put MyService.java in IONIC? Android is unable to find/bind. HOT 2
- Error on Boot
- Its not working in Android 10 HOT 1
- running cordova inside of a service HOT 5
- What is service will not running when app closed ? HOT 8
- It's Possible MyService.java Call Javascript Function ? HOT 3
- ideas to make a service to continue receiving push notifications HOT 2
- Build Android Error HOT 13
- Add method onCleanup to override
- Can I load a third party android library?
- Service starting but restart on exit failing
- Application run but factory is empty
- How to stop a Countdown when the App is backgrounded (Xamarin forms) HOT 2
- Detect the volum up pression in background service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgs-core.