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

bug: Error "Storage" plugin is not implemented on android #5430

Closed
joshuaGnol opened this issue Feb 14, 2022 · 6 comments
Closed

bug: Error "Storage" plugin is not implemented on android #5430

joshuaGnol opened this issue Feb 14, 2022 · 6 comments

Comments

@joshuaGnol
Copy link

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.4.1
  @capacitor/core: 3.4.1
  @capacitor/android: 3.4.1
  @capacitor/ios: 3.4.1

Installed Dependencies:

  @capacitor/cli: 3.2.5
  @capacitor/ios: 3.3.1
  @capacitor/core: 3.2.5
  @capacitor/android: 3.2.5

Platform(s)

Android

Current Behavior

Hi, there's errors from Sentry for Android. the plugin is working fine for both iOS and Android, just that there's errors that reported on Sentry. Could not simulate the error, only received the error from Sentry. Below is the sentry log, capacitor config and Main Activity. The Main Activity is just extend the BridgeActivity. Thank you.

Sentry log

{
arguments: [
{
code: UNIMPLEMENTED, 
message: "Storage" plugin is not implemented on android, 
name: Error, 
stack: 
Error: "Storage" plugin is not implemented on android
    at http://localhost/main.5b7ba08311886afb1ae8.js:1:1904058
    at http://localhost/main.5b7ba08311886afb1ae8.js:1:1904349
    at l.invoke (http://localhost/polyfills.2dc45994e1360d070fed.js:1:15322)
    at Object.onInvoke (http://localhost/main.5b7ba08311886afb1ae8.js:1:1446849)
    at l.invoke (http://localhost/polyfills.2dc45994e1360d070fed.js:1:15262)
    at a.run (http://localhost/polyfills.2dc45994e1360d070fed.js:1:10734)
    at http://localhost/polyfills.2dc45994e1360d070fed.js:1:21667
    at l.invokeTask (http://localhost/polyfills.2dc45994e1360d070fed.js:1:15940)
    at Object.onInvokeTask (http://localhost/main.5b7ba08311886afb1ae8.js:1:1446665)
    at l.invokeTask (http://localhost/polyfills.2dc45994e1360d070fed.js:1:15861)
    at a.runTask (http://localhost/polyfills.2dc45994e1360d070fed.js:1:11349)
    at y (http://localhost/polyfills.2dc45994e1360d070fed.js:1:17934)
}
], 
logger: console
}

capacitor config

{
    webDir: 'dist/qnnect-desktop',
    bundledWebRuntime: false,
    loggingBehavior: 'production',
    plugins: {
        SplashScreen: {
            launchAutoHide: false,
            splashFullScreen: true,
            layoutName: 'activity_splash',
            useDialog: true,
        },
        LocalNotifications: {
            smallIcon: 'notification_icon',
        },
    },
}

MainActivity.java

package com.example;
import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {}

Expected Behavior

Should not have error reported.

Code Reproduction

Other Technical Details

npm --version output: 6.14.5

node --version output: v12.18.2

Additional Context

similar issue - #4791 (comment)

document found - https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading

@jcesarmobile
Copy link
Member

Check https://capacitorjs.com/docs/android/troubleshooting#plugin-not-implemented, it contains a few things that can cause the issue.
Also try updating all the capacitor packages to the latest ones and use the same version on all of them.

@tobias-kuendig
Copy link

I was able to resolve the issue by removing the compiled frontend files and plugins and running npx cap sync android again:

rm -rf android/app/src/main/assets/*
rm -rf android/capacitor-cordova-android-plugins
npx cap sync android

If this is not enough, try running the Clean project action in Android Studio

@aschwerdt
Copy link

aschwerdt commented Apr 25, 2022

I resolved this issue by disabling minify.
android/app/build.gradle

 buildTypes {
        release {
            ...
            minifyEnabled false
            ...
        }
    }

version:
"@capacitor/core": "^3.5.0"
"@capacitor/storage": "^1.2.5"

@vikicoder007
Copy link

@capacitor/storage was working perfectly fine but after updating it to @capacitor/preferences its throwing "Storage" plugin is not implemented on android

@MaxWeisen
Copy link

@vikicoder007 I have the same exact issue except on iOS
"Storage" plugin is not implemented on ios
Screen Shot 2022-09-29 at 3 13 22 PM

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 21, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants