Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest #2

Open
Wingee opened this issue Apr 26, 2018 · 24 comments
Open

Manifest #2

Wingee opened this issue Apr 26, 2018 · 24 comments

Comments

@Wingee
Copy link

Wingee commented Apr 26, 2018

I'm getting this error in the console

[ERROR] : E/🚘 TiGeoLogger: (main) [1,185] locationTrackingService was null, cannot start. [ERROR] : E/🚘 TiGeoLogger: Maybe you forgot to add to application section of manifest

However I have added it:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest android:versionCode="1" android:versionName="1.0.0"> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23"/> <uses-permission android:name="android.permission.INTERNET"/> <!-- Keeps the processor from sleeping when a message is received. --> <uses-permission android:name="android.permission.WAKE_LOCK"/> <!-- Allows the API to cache data --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- Use GPS for device location --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <!-- Use Wi-Fi or mobile connection for device location --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <application> <service android:enabled="true" android:exported="false" android:name="ti.locationupdatesservice.LocationUpdatesService"/> </application> </manifest> </android>

Any idea why?

@AppWerft
Copy link
Owner

In new version it is fixed

@Wingee
Copy link
Author

Wingee commented May 18, 2018

Thank you @AppWerft, however I then get the following error message

[INFO] : I/🚘 TiGeoLogger: (main) [42,107] Module constructor ready [ERROR] : TiExceptionHandler: (main) [1,108] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,108] - In /app.js:15,9 [ERROR] : TiExceptionHandler: (main) [5,113] - Message: Uncaught TypeError: Tracker.setNotification is not a function [ERROR] : TiExceptionHandler: (main) [0,113] - Source: Tracker.setNotification({ [ERROR] : V8Exception: Exception occurred at /app.js:15: Uncaught TypeError: Tracker.setNotification is not a function

The example code I'm following is
`var win = Ti.UI.createWindow();

var GeoService = require("ti.locationtrackerservice");

var opts = {
lifecycleContainer : win,
interval :10, //sec.
priority : GeoService.PRIORITY_BALANCED_POWER_ACCURACY,
};
var Tracker = GeoService.createTracker(opts,function(){ // callback is optional
console.log(e.coord);
}
);
Tracker.setNotification({
channel : "cannel1",
subText : "Text nearby (on left) of titlebar",
contentTitle : "Title above the text",
bigText : "The expandable text in more then two lines",
contentText : "Longer text above",
largeIcon : "https://avatars0.githubusercontent.com/u/2996237?s=460&v=4" // optional for icon on right side

});
var Adapter = GeoService.createAdapter({ // not yet implemetented ;-(
uri: "https://mybackend.com/endpoint?my_extra_paramter=1234",
requestHeaders: ["Accesstoken:DE34B6721"],
method : "POST", // or PUT
timeout : 100000
});
Tracker.addAdapter(Adapter);
win.addEventListener("open", function() {
Tracker.requestLocationUpdates({
interval : 10,
priority : GeoService.PRIORITY_BALANCED_POWER_ACCURACY,
onlocation : function(e) {
console.log(e.latitude + ',' + e.longitude + ' @' + e.time);
}
});
});

win.open();`

@AppWerft
Copy link
Owner

Please use the current version. But it is still under work

@Wingee
Copy link
Author

Wingee commented May 21, 2018

Thanks for your help. I've tried the latest dist file 2.0.5 but I'm getting this erro

[ERROR] : TiApplication: (main) [60,60] Sending event: exception on thread: main msg:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/location/LocationServices;; Titanium 7.1.0,2018/03/14 13:40,undefined

Any ideas why this might be?

@AppWerft
Copy link
Owner

You forgot to add the ti.googleservice module.

@PietroGranati
Copy link

Updated the module, still getting (on example):

TiApplication: (main) [145,21494] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to create service ti.locationtrackerservice.LocationUpdatesService: java.lang.IllegalArgumentException; Titanium 7.1.1,2018/04/19 11:11,undefined
[ERROR] : TiApplication: java.lang.RuntimeException: Unable to create service ti.locationtrackerservice.LocationUpdatesService: java.lang.IllegalArgumentException

@PietroGranati
Copy link

Before the errors the log says:
I/💎🚘 TiGeoLogger: ------ onCreate of services
[INFO] : I/💎🚘 TiGeoLogger: setPriority: 102

@AppWerft
Copy link
Owner

In last version was an issue. Try this one.

@PietroGranati
Copy link

Ok but you've removed the dist .zip I need to rebuild it?

@AppWerft
Copy link
Owner

Nope, mom.

@PietroGranati
Copy link

PietroGranati commented May 22, 2018

For me it's not working this is all the log:

`[INFO] : I/🚘 TiGeoLogger: (main) [33359,33359] Module constructor ready

[ERROR] :  E/🚘 TiGeoLogger: (main) [3,33370] locationTrackingService was null, cannot requestLocationUpdates

[INFO] :   I/🚘 TiGeoLogger: (main) [8,33367] bindService in onStart of module was successful: true

[ERROR] :  E/🚘 TiGeoLogger: (main) [1,33371] locationTrackingService was null, cannot requestLocationUpdates

[INFO] :   I/💎🚘 TiGeoLogger: ------  onCreate of services

[INFO] :   I/💎🚘 TiGeoLogger: setPriority: 102

[ERROR] :  TiApplication: (main) [136,33507] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to create service ti.locationtrackerservice.LocationUpdatesService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.appcelerator.kroll.KrollDict.getString(java.lang.String)' on a null object reference; Titanium 7.1.1,2018/04/19 11:11,undefined

[ERROR] :  TiApplication: java.lang.RuntimeException: Unable to create service ti.locationtrackerservice.LocationUpdatesService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.appcelerator.kroll.KrollDict.getString(java.lang.String)' on a null object reference

[ERROR] :  TiApplication: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3815)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.-wrap5(Unknown Source:0)
[ERROR] :  TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1984)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:109)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:166)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:7367)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
[ERROR] :  TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.appcelerator.kroll.KrollDict.getString(java.lang.String)' on a null object reference
[ERROR] :  TiApplication: 	at ti.locationtrackerservice.LocationUpdatesService.onCreate(LocationUpdatesService.java:175)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3795)
[ERROR] :  TiApplication: 	... 8 more`

@AppWerft
Copy link
Owner

This is the Oreo issue. I'm working on it. In my local repo I have a version without notification, this version doesn't crash.

@PietroGranati
Copy link

I'll try it, but I know that Oreo blocks background service since there isn't the notification.
So, if you need some tryout call me

@AppWerft
Copy link
Owner

The problem is the usage of the right library. I'm working on it.

@AppWerft
Copy link
Owner

As you can see there are lot of issues in original repo: https://github.com/googlesamples/android-play-location/issues

@AppWerft
Copy link
Owner

I found:
android-26: Android 8.0.0 (not supported by Titanium SDK 7.1.0.GA, but may work)

NotificationManager works since 26.

@PietroGranati
Copy link

Well I see, so we need to wait until Appcelerator release a new SDK?

@AppWerft
Copy link
Owner

Currently I try to bind 26 to Titanium.

@PietroGranati
Copy link

Let me know! :)
p.s. thanks for the hard work

@AppWerft
Copy link
Owner

AppWerft commented May 22, 2018

Thanks you! It works in Nougat. The last problem is the OR€O compatibility.

@Wingee
Copy link
Author

Wingee commented May 22, 2018

Thanks for your hard work. I'm also using it on Oreo so perhaps that's what the problem is. I was under the impression that this was for O. Sorry

@AppWerft
Copy link
Owner

This works now for Oreo

@PietroGranati
Copy link

Ok now on Oreo works but I cannot see fired the location event (I copied all the code from home)

@PietroGranati
Copy link

And no notification appears :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants