angjelkom / cordova-plugin-snackbar

Cordova Plugin that displays a Material Design Snackbar
Apache License 2.0
9 stars 7 forks source link

no snackbar on Samsung Galaxy S4 - 4.2.2 - API 17 #1

Closed zwacky closed 7 years ago

zwacky commented 8 years ago

hey there on a Galaxy S4 (4.2.2) there is no snackbar shown and no errors in logcat and console.

is there an API requirement? if no, maybe a isAvailable() function is useful?

cheers

angjelkom commented 8 years ago

@zwacky thanks for using snackbar plugin, currently at work after finish will try to repro on 4.2.2 and inform you, but it should work fine!

angjelkom commented 8 years ago

@zwacky Can you test if it works fine on other device? Also could you please upload a sample of your app where the plugin doesn't work. Thanks!

zwacky commented 8 years ago

it does work fine on other devices (nexus 5+).

i just used the window.cordova.plugins.snackbar(...) directly in the console in both devices. tried on genymotion, Samsung Galaxy S4 - 4.2.2 - API 17.

angjelkom commented 8 years ago

@zwacky I used Genymotion Samsung Galaxy S4 - 4.2.2 -API 17 and it's working fine. Could you please paste the code where you add the snackbar. Or app sample even better! screenshot from 2016-06-09 21 25 11

zwacky commented 8 years ago

I use window.cordova.plugins.snackbar('Test', 'SHORT', 'DISMISS'); from the console and it doesn't show up.

on a nexus 5 emulator though it does.

angjelkom commented 8 years ago

@zwacky Could you please what debug tool do you use, I just tried and still works fine even with:

window.cordova.plugins.snackbar('Test', 'SHORT', 'DISMISS');

zwacky commented 8 years ago

that is weird... i'm using chrome dev tools, along with xwalk 15

ishigo1987 commented 8 years ago

i have a same problem i'm using the snackbar plugin like that function ajaxError() cordova.plugins.snackbar('Pas de connexion internet', 'INDEFINITE', 'Réessayez', function(){ var cloneRecursive; if(activeView === "pfluxrss") { cloneRecursive = new GetRssFlux(headerName,urlToFluxRss,fillPanel); } else if(activeView === "pweather") { cloneRecursive = new GetWeather(url, loader); }

});

} And somewhere else in the code when the ajax request return an error i calling ajaxError(); when i'm doing that my app crashed both on cordova app and crosswalk cordova app i have an android 5.1

zwacky commented 8 years ago

@ishigo1987 if it's crashing, then it's another issue. for me it simply was ignored.

I also had crashes before, but could resolve them. you may wanna start adb logcat and see what causes the error.

ishigo1987 commented 8 years ago

how to use adb logcat?i'm using intel xdk to build the app and i'm very newbie with the log file on android

ishigo1987 commented 8 years ago

i think that i need to download android studio before you can use adb logcat is it true?

zwacky commented 8 years ago

only the android SDK is needed - which you have, since you build the android app on your machine. just type adb logcat into your command line. if that doesn't work, you'd need to adjust your system environment paths to include android SDK directory. google that for your platform, if you need assistance with it.

ishigo1987 commented 8 years ago

ok copy thank you

angjelkom commented 8 years ago

@ishigo1987 you must replace the DefaultTheme with the AppCompat Theme in Manifest file manually:

https://github.com/echonox/cordova-plugin-snackbar#androidthemeandroidstylethemedevicedefaultnoactionbar

ishigo1987 commented 8 years ago

@echonox I use intel xdk, accordancing with their documentation it is not possible to directly manipulate the manifest file (as it is in the cloud) .on needs to be able to manipulate create a fake plugin and add the information in plugin.xml below here is the content of my plugin.xml. But it does not work. can you tell me please where I am wrong? <?xml version="1.0" encoding="UTF-8"?>

``` Ajout AndroidManifest Ajout de données dans le Manifest Android MIT ```
angjelkom commented 8 years ago

@ishigo1987 That is the reason that it must be edited manually I know that we can modify the Manifest file via plugin, but the problem is that cordova isn't replacing the theme instead it adds a new line to the manifest file which ends up in an error.

A workaround for your problem: You could build the app with Intel XDK get the APK and then with 7zip edit the manifest file replace the line and pack the manifest file back to the apk with 7zip

ishigo1987 commented 8 years ago

I open the Manifest but it is encrypted. please do you know how I can do to decrypt the Manifest File?

angjelkom commented 7 years ago

@ishigo1987 Intel XDK announced they are abandoning the project, sorry but can't do anything regarding this issue

ishigo1987 commented 7 years ago

no problem @echonox i leave intel xdk since a decade lol