cordova-plugin-background-geolocation-example icon indicating copy to clipboard operation
cordova-plugin-background-geolocation-example copied to clipboard

White screen on Android

Open angel1st opened this issue 7 years ago • 9 comments

Hi there, I just checked out the code, followed the instructions and compiled an Android debug apk. When it was installed on the device (Android 8.0.0), I ended up with white screen. Console log says:

TypeError: (0 , o.default)(...).darken(...).hex is not a function app.js:1 at Object.get statusBarColor [as statusBarColor] (file:///android_asset/www/app.js:1:4701) at file:///android_asset/www/app.js:1:36865 at fr (file:///android_asset/www/app.js:1:27433) at file:///android_asset/www/app.js:1:36667 at Function.ll (file:///android_asset/www/app.js:1:52475) at e (file:///android_asset/www/app.js:11:234047) at file:///android_asset/www/app.js:11:234184 at file:///android_asset/www/app.js:1:36862 at fr (file:///android_asset/www/app.js:1:27433) at file:///android_asset/www/app.js:1:36667

Any help would be appreciated.

angel1st avatar Jul 03 '18 11:07 angel1st

Delete node modules folder and do fresh modules install

On Tue, 3 Jul 2018 at 13:10, Angel [email protected] wrote:

Hi there, I just checked out the code, followed the instructions and compiled an Android debug apk. When it was installed on the device (Android 8.0.0), I ended up with white screen. Console log says:

TypeError: (0 , o.default)(...).darken(...).hex is not a function app.js:1 at Object.get statusBarColor [as statusBarColor] (file:///android_asset/www/app.js:1:4701) at file:///android_asset/www/app.js:1:36865 at fr (file:///android_asset/www/app.js:1:27433) at file:///android_asset/www/app.js:1:36667 at Function.ll (file:///android_asset/www/app.js:1:52475) at e (file:///android_asset/www/app.js:11:234047) at file:///android_asset/www/app.js:11:234184 at file:///android_asset/www/app.js:1:36862 at fr (file:///android_asset/www/app.js:1:27433) at file:///android_asset/www/app.js:1:36667

Any help would be appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mauron85/cordova-plugin-background-geolocation-example/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV8GsULKOywAaxHUqdLYbqF_D1Z0Rlfks5uC1EXgaJpZM4VAvod .

mauron85 avatar Jul 03 '18 15:07 mauron85

Nope, it didn't work. What I did:

  1. Deleted node_modules folder
  2. Executed npm install
  3. Started app in debug mode --> received the exact same error as above.

P.S. Note sure how relevant it is - I am using Windows 10 Home as development environment. I had no issues to compile and execute your previous example, so I would speculate the issue is not related to dev. environment.

angel1st avatar Jul 03 '18 16:07 angel1st

you need to rebuild app too:

npm run build

mauron85 avatar Jul 03 '18 17:07 mauron85

@mauron85 - no luck again. BTW - sorry if I am asking for the obvious, but how repeating the steps which failed to deliver exception free app once will fix it on the next iteration?

angel1st avatar Jul 03 '18 18:07 angel1st

There is another suggestion in https://github.com/mauron85/cordova-plugin-background-geolocation-example/issues/16. I believe this is some kind of dependency issue, where two packages are using different versions of some dependency. Don't think I can do much here.

mauron85 avatar Jul 03 '18 18:07 mauron85

Basically guy used yarn instead of npm.

mauron85 avatar Jul 03 '18 18:07 mauron85

Thanks, So basically, as mentioned in #16, the actual reason is having package-lock.json which in fact caused this dependencies mismatch. The workaround on this issue is:

  1. Delete node_modules folder
  2. Install packages using yarn
  3. Build the app using npm run build

@mauron85 - I do agree with @pmatheush the best would be to update the readme file, this will save you from further identical inquiries.

angel1st avatar Jul 04 '18 07:07 angel1st

You probably ment there is no package-lock.json but yarn.lock. Anyway, there should be no need to have any of those lock files.. Apparently there is some dependency issue problem as reported in https://github.com/GeekyAnts/NativeBase/issues/1354

mauron85 avatar Jul 04 '18 08:07 mauron85

Actually, package-lock.json is generated automatically, whenever npm 5.x.x+ command is used e.g. npm install. This is according to npm documentation. When yarn is used instead of npm install, package-lock.json creation is skipped, hence subsequent npm run build produces a runnable app.

angel1st avatar Jul 04 '18 14:07 angel1st