capacitor-community / sqlite

⚡Capacitor plugin for native & electron SQLite databases.
MIT License
496 stars 118 forks source link

Crash Error while SDK initialization in iOS #379

Closed neelpatel63moons closed 1 year ago

neelpatel63moons commented 1 year ago

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CapacitorSQLitePlugin getConfig]: unrecognized selector sent to instance 0x7fc5cd215530' in ios swift

jepiqueau commented 1 year ago

@neelpatel63moons thanks for reporting but you have to give some more infos plugin version package.json and the part of code where the error occurs

jepiqueau commented 1 year ago

@neelpatel63moons give also your capacitor.config.ts file

neelpatel63moons commented 1 year ago

capacitor-community/sqlite: 4.6.0

capacitor.config.ts file

import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { appId: 'com.abc.dev', appName: 'xyz', webDir: 'www', bundledWebRuntime: false, plugins: { SplashScreen: { launchAutoHide: false } } }; export default config;

jepiqueau commented 1 year ago

@neelpatel63moons look at the api.md doc you must have a config for the plugin CapacitorSqlite

jepiqueau commented 1 year ago

@neelpatel63moons Any feedback or i will close the issue

neelpatel63moons commented 1 year ago

@jepiqueau Not yet. It is working in standalone application. But when I implement to iOS SDK, it is giving crash

jepiqueau commented 1 year ago

@neelpatel63moons What do you mean by implement to iOS SDK? Can you share your app

neelpatel63moons commented 1 year ago

I am creating framework file of app in iOS and then I import that framework in iOS Parent App.

@neelpatel63moons What do you mean by implement to iOS SDK? Can you share your app

jepiqueau commented 1 year ago

@neelpatel63moons can you share a simple repro app with the process you use.

neelpatel63moons commented 1 year ago

@neelpatel63moons can you share a simple repro app with the process you use.

1.) I have my code in Ionic Angular Capacitor and in this I am using Capacitor-community/sqlite. 2.) From this I am adding iOS platform. 3.) From this iOS Platform I am copying public folder, config.xml, capacitor.config.json, info.plist files to iOS Native framework Project. 4.) Then I import mentioned 4 files to framework project and create build. In this build which we get will be .framework file. 5.) I am importing this .framework file to another iOS Native Project. Try to run that app in iOS Device there I am facing crash just because of capacitor-community/sqlite plugin. Without this plugin app is running fine.

neelpatel63moons commented 1 year ago

@neelpatel63moons can you share a simple repro app with the process you use.

1.) I have my code in Ionic Angular Capacitor and in this I am using Capacitor-community/sqlite. 2.) From this I am adding iOS platform. 3.) From this iOS Platform I am copying public folder, config.xml, capacitor.config.json, info.plist files to iOS Native framework Project. 4.) Then I import mentioned 4 files to framework project and create build. In this build which we get will be .framework file. 5.) I am importing this .framework file to another iOS Native Project. Try to run that app in iOS Device there I am facing crash just because of capacitor-community/sqlite plugin. Without this plugin app is running fine.

@jepiqueau

jepiqueau commented 1 year ago

@neelpatel63moons Are you also using other capacitor plugins provided by the capacitor team and did they work following the same process?

jepiqueau commented 1 year ago

@neelpatel63moons any news?