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

Compiling correctly but not working? #291

Open
luigi37 opened this issue Feb 28, 2019 · 14 comments
Open

Compiling correctly but not working? #291

luigi37 opened this issue Feb 28, 2019 · 14 comments

Comments

@luigi37
Copy link

luigi37 commented Feb 28, 2019

Looks like the plugin compiles properly on Android but no notification.
I'm using Android 8.0 on Samsung... anyone had success in compiling an app and making the geofence work?

@Nikituh
Copy link

Nikituh commented Mar 4, 2019

It's working as intended, I suppose. Android 8 introduced new logic to notifications, and considering the last commit was 2 years ago, it's impossible that the author of this plugin could have accounted for that.

Starting in Android 8.0 (API level 26), all notifications must be assigned to a channel or it will not appear. By categorizing notifications into channels, users can disable specific notification channels for your app (instead of disabling all your notifications), and users can control the visual and auditory options for each channel—all from the Android system settings (figure 11). Users can also long-press a notification to change behaviors for the associated channel.

https://developer.android.com/guide/topics/ui/notifiers/notifications

@luigi37
Copy link
Author

luigi37 commented Mar 4, 2019

Hi, of course no criticism to the developer or the plugin in itself but fact is that as per today it seems there is no working geofence plugin. So... is there any fork working (also) on Android 8 or any workaround to make this one working?

@Nikituh
Copy link

Nikituh commented Mar 4, 2019

I'm not sure, I stumbled upon this repository by accident and just thought I'd answer your question. There are 259 forks of this repository, one of them is bound to have accounted for notifications in Android 8. If not, you can make your own fork and fix it. It's relatively straight-forward:

https://developer.android.com/training/notify-user/channels

@salarelv
Copy link

salarelv commented Mar 5, 2019

I have a fork that builds on Android 8 but not sure if it sends the notification yet. First order was to get it building.
https://github.com/3dtech/cordova-plugin-geofence

@luigi37
Copy link
Author

luigi37 commented Mar 5, 2019

Thanks. Do you want me to give your fork a try? BTW: with the main repository I noticed a weird behavior on Android simulator (Android 7), it only issues notifications if Google Maps is open...

@salarelv
Copy link

salarelv commented Mar 5, 2019

Wouldn't hurt if somebody else tries out. I am currently fighting some other plugin and do not have time to test it myself.

@luigi37
Copy link
Author

luigi37 commented Mar 5, 2019

Ok: I was not sure if it was ready for testing. Now that you confirmed, I'm fine to test (likely tonight :-) ) Thanks!

@luigi37
Copy link
Author

luigi37 commented Mar 21, 2019

Still not wroking.... is there any fork that compile and works properly on Android 8? Thanks

@gemigkaka
Copy link

@luigi37 Try mine if you want to: https://github.com/gemigkaka/cordova-plugin-geofence
It compiles and works with notifications for Android 8+.
I haven't updated the documentation yet, but as you'll see in GeofencePlugin.java, there's also functionality to dismiss notifications.

@luigi37
Copy link
Author

luigi37 commented Mar 29, 2019

Thank you so much! I was sure someone else (with better developer skills than me :-) ) could have had the same need but I was almost loosing hope! I will give it a try in the weekend!

@gemigkaka
Copy link

No problem :) Please tell if you find any issues.

@luigi37
Copy link
Author

luigi37 commented Mar 31, 2019

I'm getting this error:
Error: /home/..................../platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/l...................../platforms/android/src/com/cowbell/cordova/geofence/GeofencePlugin.java:33: error: diamond operator is not supported in -source 1.6
private static HashMap<String, Long> snoozedFences = new HashMap<>();
^
(use -source 7 or higher to enable diamond operator)
/home/.............platforms/android/src/com/cowbell/cordova/geofence/TransitionJobService.java:31: error: lambda expressions are not supported in -source 1.6
Thread thread = new Thread(() -> {
^
(use -source 8 or higher to enable lambda expressions)
/home......./platforms/android/src/com/cowbell/cordova/geofence/ReceiveTransitionsReceiver.java:65: error: diamond operator is not supported in -source 1.6
List geoNotifications = new ArrayList<>();
^
(use -source 7 or higher to enable diamond operator)
/home.........platforms/android/src/com/cowbell/cordova/geofence/RemoveGeofenceCommand.java:28: error: lambda expressions are not supported in -source 1.6
.addOnSuccessListener((Void aVoid) ->
^
(use -source 8 or higher to enable lambda expressions)
4 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I'm using

**cordova --version
7.1.0

cordova platform
Installed platforms:
android 6.3.0
ios 4.5.5**

@gemigkaka
Copy link

It sounds like you're missing JDK 8 or the JAVA_HOME variable. Since cordova-android 6.3.0 JDK 8 is required.
Check here: https://cordova.apache.org/docs/en/latest/guide/platforms/android/#installing-the-requirements
(go to Installing the Requirements > Java Development Kit (JDK))

@luigi37
Copy link
Author

luigi37 commented Apr 2, 2019

In effect I have:
java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

And
javac -version
javac 1.8.0_191

would that work?

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

4 participants