bug: Statusbar plugin got error in Andriod Studio: Line 2 - Msg: Error: "StatusBar" plugin is not implemented on android
See original GitHub issueBug Report
Capacitor Version
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 2.4.6 @capacitor/core: 2.4.6 @capacitor/android: 2.4.6 @capacitor/ios: 2.4.6
Installed Dependencies:
@capacitor/ios: not installed @capacitor/cli: 3.0.0-beta.1 @capacitor/core: 3.0.0-beta.1 @capacitor/android: 3.0.0-beta.1
[success] Android looking great!
E/Capacitor/Console: File: http://localhost:8100/static/js/4.a14c6c57.chunk.js - Line 2 - Msg: Error: “StatusBar” plugin is not implemented on android E/Capacitor: JavaScript Error: {“type”:“js.error”,“error”:{“message”:“Uncaught Error: "StatusBar" plugin is not implemented on android”,“url”:“http://localhost:8100/static/js/4.a14c6c57.chunk.js",“line”:2,“col”:178972,“errorObject”:"{\“code\”:\“UNIMPLEMENTED\”}”}} E/Capacitor/Console: File: http://localhost:8100/static/js/4.a14c6c57.chunk.js - Line 2 - Msg: Uncaught Error: “StatusBar” plugin is not implemented on android
Platform(s)
Andriod Studio
Current Behavior
I am coding by using “@capacitor/core”: “^3.0.0-beta.1” and “@capacitor/status-bar”: “^0.4.0”, follow the document, i added below two lines to index.tsx:
import { StatusBar } from ‘@capacitor/status-bar’; StatusBar.setOverlaysWebView({ overlay: true });
, then, ionic build -> npx cap sync -> run in Android Studio, and got this error.
E/Capacitor/Console: File: http://localhost:8100/static/js/4.a14c6c57.chunk.js - Line 2 - Msg: Error: “StatusBar” plugin is not implemented on android E/Capacitor: JavaScript Error: {“type”:“js.error”,“error”:{“message”:“Uncaught Error: "StatusBar" plugin is not implemented on android”,
Expected Behavior
Display content under transparent status bar in Andriod
Code Reproduction
`import React from ‘react’; import ReactDOM from ‘react-dom’; import App from ‘./App’; import * as serviceWorker from ‘./serviceWorker’;
import { StatusBar } from ‘@capacitor/status-bar’; StatusBar.setOverlaysWebView({ overlay: true });
ReactDOM.render(<App />, document.getElementById(‘root’));
// If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: https://bit.ly/CRA-PWA serviceWorker.unregister();`
Other Technical Details
npm --version
output: 6.13.4
node --version
output: v12.16.1
pod --version
output (iOS issues only):
Additional Context
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
Looks like there’s already an issue for it: https://github.com/ionic-team/capacitor/issues/739
Interesting. We should probably check that the built-in code shrinker for Android doesn’t remove plugin classes that it thinks are “unused”.