deep-foundation / deep-memo-app

The Unlicense
11 stars 8 forks source link

Error: "Preferences" plugin is not implemented on android #127

Closed FreePhoenix888 closed 7 months ago

FreePhoenix888 commented 10 months ago

Description

I get Error: "Preferences" plugin is not implemented on android error in android app.

How to reproduce

Additional Information

Version of @capacitor/preferences

freephoenix888@FreePhoenix888:~/Programming/deep/deep-memo-app$ npm list @capacitor/preferences
@deep-foundation/deep-memo@0.0.0 /home/freephoenix888/Programming/deep/deep-memo-app
├── @capacitor/preferences@5.0.6
├─┬ @deep-foundation/deeplinks@0.0.303
│ └─┬ @deep-foundation/store@0.0.25
│   └── @capacitor/preferences@5.0.6 deduped
└─┬ @deep-foundation/store@0.0.27
  └── @capacitor/preferences@5.0.6 deduped

Direct capacitor dependencies

freephoenix888@FreePhoenix888:~/Programming/deep/deep-memo-app$ npm list | grep capacitor
├── @capacitor-community/contacts@5.0.4
├── @capacitor-community/electron@4.1.2
├── @capacitor/android@5.0.5
├── @capacitor/cli@5.0.5
├── @capacitor/core@5.0.5
├── @capacitor/device@5.0.4
├── @capacitor/dialog@5.0.4
├── @capacitor/haptics@5.0.4
├── @capacitor/ios@5.0.5
├── @capacitor/preferences@5.0.6
├── @deep-foundation/capacitor-camera@1.1.10
├── @deep-foundation/capacitor-device@18.0.0-dev.8
├── @deep-foundation/capacitor-geolocation@1.0.0-dev.14
├── @deep-foundation/capacitor-motion@7.0.2
├── @deep-foundation/capacitor-network@0.1.10
├── @deep-foundation/capacitor-voice-recorder@1.2.6
├── capacitor-voice-recorder@5.0.0

Capacitor dependencies (depth 10)

freephoenix888@FreePhoenix888:~/Programming/deep/deep-memo-app$ npm list --depth 10 | grep capacitor
├─┬ @capacitor-community/contacts@5.0.4
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor-community/electron@4.1.2
│ ├─┬ @capacitor/cli@3.9.0
│ ├─┬ @capacitor/core@3.9.0
├─┬ @capacitor/android@5.0.5
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor/cli@5.0.5
├─┬ @capacitor/core@5.0.5
├─┬ @capacitor/device@5.0.4
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor/dialog@5.0.4
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor/haptics@5.0.4
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor/ios@5.0.5
│ └── @capacitor/core@5.0.5 deduped
├─┬ @capacitor/preferences@5.0.6
│ └── @capacitor/core@5.0.5 deduped
├─┬ @deep-foundation/capacitor-camera@1.1.10
│ ├─┬ @capacitor/camera@5.0.7
│ │ └── @capacitor/core@5.0.5 deduped
│ ├─┬ @deep-foundation/capacitor-device@14.0.3
│ │ ├── @capacitor/device@5.0.4 deduped
├─┬ @deep-foundation/capacitor-device@18.0.0-dev.8
│ ├── @capacitor/device@5.0.4 deduped
├─┬ @deep-foundation/capacitor-geolocation@1.0.0-dev.14
│ ├─┬ @capacitor/geolocation@5.0.6
│ │ └── @capacitor/core@5.0.5 deduped
├─┬ @deep-foundation/capacitor-motion@7.0.2
│ ├── @capacitor/device@5.0.4 deduped
│ ├─┬ @capacitor/motion@5.0.6
│ │ └── @capacitor/core@5.0.5 deduped
│ ├─┬ @deep-foundation/capacitor-device@10.0.1
│ │ ├── @capacitor/device@5.0.4 deduped
├─┬ @deep-foundation/capacitor-network@0.1.10
│ ├─┬ @capacitor/network@5.0.6
│ │ └── @capacitor/core@5.0.5 deduped
│ ├─┬ @deep-foundation/capacitor-device@14.0.3
│ │ ├── @capacitor/device@5.0.4 deduped
├─┬ @deep-foundation/capacitor-voice-recorder@1.2.6
│ ├── capacitor-voice-recorder@5.0.0 deduped
│ │ ├── @capacitor/core@5.0.5 deduped
│ │ ├── @capacitor/preferences@5.0.6 deduped
│ │ │ │ ├─┬ @types/fs-capacitor@2.0.0
│ │ │ │ ├── fs-capacitor@2.0.4
│ ├── @capacitor/device@5.0.4 deduped
│ ├─┬ @capacitor/push-notifications@5.1.0
│ │ └── @capacitor/core@5.0.5 deduped
│ ├─┬ @deep-foundation/capacitor-device@10.0.1
│ │ ├── @capacitor/device@5.0.4 deduped
│ ├── @capacitor/core@5.0.5 deduped
│ ├── @capacitor/preferences@5.0.6 deduped
├─┬ capacitor-voice-recorder@5.0.0
│ ├── @capacitor/core@5.0.5 deduped
Checklist - [X] `package.json` ❌ Failed
• Check if "@capacitor/preferences" is listed in the "dependencies" section. If not, add it with the correct version.
- [X] `android/capacitor.settings.gradle` ✅ Commit [`e8da91d`](https://github.com/deep-foundation/deep-memo-app/commit/e8da91d4c4c41af413aeff0ed5fb56abbacbaa08)
• Check if the Preferences plugin is included in the file. If not, add the following lines: include ':@capacitor/preferences' project(':@capacitor/preferences').projectDir = new File('../node_modules/@capacitor/preferences/android')
- [X] `components/page.tsx` ✅ Commit [`1a936da`](https://github.com/deep-foundation/deep-memo-app/commit/1a936da99554cfa0c85907758c895bb43043b706)
• Check if the Preferences plugin is correctly imported at the top of the file. If not, add the following line: import { Preferences } from '@capacitor/preferences'; • Check if the Preferences plugin is correctly used in the code. If not, correct the usage according to the plugin documentation.
- [X] `android/app/src/main/java/com/deepfoundation/deep/MainActivity.java` ✅ Commit [`8c9ace4`](https://github.com/deep-foundation/deep-memo-app/commit/8c9ace4a10b4107b57d5803d9a5c31338e56c961)
• Check if the Preferences plugin is correctly initialized for Android. If not, add the following lines in the onCreate method: import com.capacitor.preferences.Preferences; ... this.init(savedInstanceState, new ArrayList>() {{ ... add(Preferences.class); ... }});
Konard commented 10 months ago

sweep fix it

FreePhoenix888 commented 10 months ago

Sweep: fix it

deep-foundation-sweepai[bot] commented 10 months ago

Here's the PR! https://github.com/deep-foundation/deep-memo-app/pull/128.

💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/deep-foundation/deep-memo-app/blob/a311199df3b87efade46383dc68a4e80ca9607b6/components/monitoring.tsx#L1-L92 https://github.com/deep-foundation/deep-memo-app/blob/a311199df3b87efade46383dc68a4e80ca9607b6/imports/contact/package-name.ts#L1-L0 https://github.com/deep-foundation/deep-memo-app/blob/a311199df3b87efade46383dc68a4e80ca9607b6/components/page.tsx#L2-L138 https://github.com/deep-foundation/deep-memo-app/blob/a311199df3b87efade46383dc68a4e80ca9607b6/android/capacitor.settings.gradle#L1-L17 https://github.com/deep-foundation/deep-memo-app/blob/a311199df3b87efade46383dc68a4e80ca9607b6/pages/index.tsx#L14-L121
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://github.com/deep-foundation/deep-memo-app.git: The page is a GitHub repository for the project "deep-memo-app" by deep-foundation. The repository contains code for a memo app developed using Capacitor, a cross-platform app development framework. The user is experiencing an error related to the "Preferences" plugin in the Android version of the app. The error message suggests that the plugin is not implemented on Android. The user provides additional information about the versions of the "@capacitor/preferences" plugin and other Capacitor dependencies used in the project. The user also includes steps to reproduce the error and logs from the Android app.

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/fix-preferences-plugin-error.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord