Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70904 articles
Browse latest View live

Error building an app with Capacitor 5 and Android SDK 32

$
0
0

Hi everyone,
Im build a new app everything works as espected when I build it for android 13
But some of the clients have older phones, so im trying to compile the app for android 12.
but when I change :
minSdkVersion = 32
compileSdkVersion = 32
targetSdkVersion = 32

and graddle to 7.5.1, and graddle android plugin to 7.4.2

I got this error

/node_modules/@capacitor/android/capacitor/src/main/java/com/getcapacitor/util/InternalUtils.java:15: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)

anyone knows where or how find the solution

2 posts - 2 participants

Read full topic


Android app doesn't extend the view into the camera edge

$
0
0

Hi there! I’m developing an Android/iOS app and I need the view to include the screen’s top part, where the camera is. Currently, this works perfectly on iOS, but on Android I get a grey box instead (see picture). Does anyone know how to fix this? Thanks in advance.

1 post - 1 participant

Read full topic

[Ionic 7.6.3] ion-button with ion-badge hover border issue?

$
0
0

Hi Fam

I have a small issue. I am able to add a badge to a button top right with some css, however when I hover on the button, the borders of the button change from their default state. Please see the gif below.

ButtonBadge

This is the html i’m using

I have added a css rule of #button1.hasbadge::part(native) {overflow!visible}

How do I fix the border-issue on hover, everything else works as expected?

Thanks in advance.

PS: My apologies, i dont know how to embed html into this input

1 post - 1 participant

Read full topic

How to solve this using ionic react and mongodb realm

$
0
0

I created a basic functionality but the realm has an error says that,

[plugin:vite:import-analysis] Failed to resolve entry for package “realm”. The package may have incorrect main/module/exports specified in its package.json: No known conditions for “.” specifier in “realm” package

This is my code using mongodb realm. I want to use the offline first architecture that can use CRUD offline and sync when back to online. Help me please.

import React, { useEffect, useState } from ‘react’;
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonList, IonItem, IonLabel, IonInput, IonButton } from ‘@ionic/react’;
import Realm from ‘realm’;

export const TaskSchema = {
name: ‘Task’,
properties: {
_id: ‘objectId’,
task: ‘string?’,
},
primaryKey: ‘_id’,
};

const App: React.FC = () => {
const [realm, setRealm] = useState<Realm | null>(null);
const [tasks, setTasks] = useState<any>();
const [taskInput, setTaskInput] = useState(‘’);

const initRealm = async () => {
const app = new Realm.App({ id: ‘mongodbsync-ymnsn’ });
const user = await app.logIn(Realm.Credentials.anonymous());
const config = {
schema: [TaskSchema],
sync: {
user,
partitionValue: ‘public’,
},
};
const realmInstance = await Realm.open(config);
setRealm(realmInstance);
};

const addTask = async () => {
if (realm) {
realm.write(() => {
realm.create(‘Task’, { _id: new Realm.BSON.ObjectId(), task: taskInput });
});
setTaskInput(‘’);
}
};

const syncTasks = async () => {
if (realm) {
await realm.syncSession.uploadAllLocalChanges();
}
};

useEffect(() => {
if (!realm) {
initRealm();
} else {
const taskResults = realm.objects(‘Task’);
setTasks(taskResults);
}
}, [realm, tasks]);

return (



Ionic Realm App




{tasks.map((task) => (

{task.task}

))}


<IonInput placeholder=“New Task” value={taskInput} onIonChange={(e) => setTaskInput(e.detail.value!)} />
Add
Sync



);
};

export default App;

1 post - 1 participant

Read full topic

@for on an array that I need to remove and add back items

$
0
0

Angular is trying to do magic in its big black box behind the scenes. I I remove an item from an array that has an element displayed for it via the @for directive in the template, and then I add it back, it’ll reuse a half-baked old copy of the element that no long has the events attached to it and a bunch of formatting all messed up.

I have a type of double list control on the screen where the user can move items back and forth.

It appears that if I change the tracking ID before adding it back, it might work, but that breaks all my software so now I need to hack it.

Is there a way to disable the caching of elements? I don’t care about performance when I’m only dealing with a half dozen items in the list.

1 post - 1 participant

Read full topic

Hybrid Flooring in Melbourne

[For Hire] Ionic Developer- Available for full time/part time/project basis

$
0
0

Hello Everyone,

Anyone looking to upgrade, create, redesign or customize their app built in Ionic/Flutter/React or any other app technology in cost effective rates?

If yes, I can surely assist you. Please DM me with the task details.

You can also reach me over email- monita.bangade@protonshub.in
Also book your quick meeting slot in this link Calendly - Monita Bangade.

Thanks & Regards
Monita
Skype: live:.cid.6cfcb78e61c26875

1 post - 1 participant

Read full topic

HTML and CSS Editor Platforms?

$
0
0

Hi All

I have been working on my app, but now I need to update the theme/ overall look by changing the HTML and CSS.

The team member who could be working on the HTML and CSS has not got much experience with Ionic, so I would like to know if there is any platform or way I can present to them only the HTML/ CSS to edit or work on.

4 posts - 2 participants

Read full topic


No scrollbar seen on a page with ion-content

$
0
0

I’m working in visual studio, with ionic v7 and angular v17 and capacitor. I started a new ionic/angular project and the angular components are standalone. I have a page with an ion-grid inside ion-content, and the grid is too big to fit on a single screen of my android phone or when running on the web emulating various kinds of phones. My problem is that there is no vertical scrollbar appearing either on my phone or on the web emulators, so I cannot see the lower content of my ion-grid. swiping up on my phone has no effect either. I am stumped as to why this is happening - isn’t scrolling enabled automatically by ionic when it is needed on a page?

2 posts - 2 participants

Read full topic

Should I even ask about M1 MacBooks and Ionic 3

$
0
0

I have begged my company to do something with an old Ionic app, written in Ionic 3. I have a MacBook around just for the purpose of supporting this old app. Now my companies computer team says it’s time for a new MacBook and I confirmed it would be an M1 chip. How bad would the headache be if I tried to get 6 year old ionic 3 code working on a M1 MacBook.

Ionic Info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.3
    ionic (Ionic CLI) : 3.20.1

global packages:

    cordova (Cordova CLI) : 10.0.0 (cordova-lib@10.1.0) 

local packages:

    @ionic/app-scripts : 3.2.4
    Cordova Platforms  : browser 6.0.0 iOS 5.1.1
    Ionic Framework    : ionic-angular 3.9.10

System:

    ios-deploy : 1.12.1 
    ios-sim    : 8.0.2 
    Node       : v12.19.0
    npm        : 6.14.8 
    OS         : macOS
    Xcode      : Xcode 14.3.1 Build version 14E300c 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

1 post - 1 participant

Read full topic

How to disable swipe back gesture, swipeBackEnabled doesn't work

$
0
0

I’m trying to disable the swipe-back feature. I put swipeBackEnabled: false to config, but it only works on IOS. When I run the app on an Android device, the swipe gestures are still there.

main.js

const app = createApp(App)
  .use(IonicVue, {
    swipeBackEnabled: false
  })
  .use(router)
  .use(createPinia())

router.isReady().then(() => {
  app.mount('#app')
})

I also try to disable swipeGesture in App.vue, but still did not work.

App.vue:

<template>
  <ion-app>
    <ion-router-outlet swipeGesture="false"/>
  </ion-app>
</template>

Please help, thank you.

1 post - 1 participant

Read full topic

Sanjeev Mansotra - Is Ionic a JavaScript framework?

$
0
0

Hello, myself Sanjeev Mansotra, I’m new to this community. I joined to learn more about the ionic framework. How can I learn from scratch in less time and is it a javascript framework?
I know JavaScript will it be enough to learn ionic framework?
Waiting for your response! Thanks :slight_smile:

1 post - 1 participant

Read full topic

Adjusting root element font size for Dynamic Font Scaling for iOS

$
0
0

Hello,

We have build an app using Ionic React (currently v7.5) which runs on iOS, Android and as web app in the browser.

We have followed Ionic’s Dynamic Font Scaling guide (Dynamic Font Scaling | Ionic Documentation) to enable dynamic font scaling for iOS and Android. We have changed all font-sizes and line-heights in our CSS files from px to rem using a conversion rate of 16px to 1rem. After that change, dynamic font scaling on iOS and Android devices works.

What we have noticed is that a conversion rate of 16px to 1rem is pretty common. The exception is iOS, which uses a conversion of 17px (default font size) to 1rem. This is also mentioned in Ionic’s Dynamic Font Scaling guide (last section). This causes layout issues in our app on iOS devices in certain places since our UX designer has designed everything in px units and some texts are included in other graphical components that have a certain height (in px).

The solution would be to change the default font size for iOS to 16px, so the same conversion rate is applied to all target platforms (iOS, Android, web).

We can set the default font size to 16px using the following code in our CSS file:

html {
font-size: 16px;
}

This will change the default font size to 16px on iOS. However, dynamic font sizing is not working after this change.

Question: is there a way to change the default font size to 16px for iOS while keeping the dynamic font sizing feature enabled?

Kind regards,

Ronald

1 post - 1 participant

Read full topic

Best-practice for layouting (IonItem vs IonGrid vs div ...)

$
0
0

Hello,

We have build an app using Ionic React (currently v7.5) that we deploy to iOS, Android and browser.

Our UX designer has designed components that have multiple elements (text, icon, image, etc.) aligned horizontally next to each other. For example:

  • A Card component that has an image on the left, text in the middle and an icon with text on the right.
  • An Explainer component that has a text to the left and a text to the right, divided by a vertical dash

Often these horizontally aligned elements have a specific width (e.g. 50%) or should be the element that fills up the remaining horizontal space. Ideally, this fits in flexbox layout.

Question: we are looking for the best-practice on what component to use for such layouting.

Some options:

Use of IonItem

  • Pro: it can be modified to have the appropriate dimensions.
  • Con: in terms of function, it should be used as a list item (while in this case it is used as structural element outside a list). Accessibility checks flag an IonItem that is not part of a list as a component with a role “listitem” that is not part of a list (critical/severe accessibility issue).

Use of divs (flexbox)

  • Pro: it can be easily configured to have the appropriate dimensions using flexbox.
  • Con: meaningless (non-functional) element that is being discouraged to use from accessibility point-of-view.

Use of IonGrid

  • Pro: it can be easily configured (IonGrid, IonRow, IonCol) to have the appropriate dimensions.
  • Pro: it seems to be in-line with accessibility rules in terms of appropriate roles
  • Question: we don’t know if it is intended for smaller (fine-grained) layouting of components on a page, or only for the main layout of an app? We also have a main grid using IonGrid in our app, so we have different “nested” grids if we use this approach.

Curious to hear about best-practices from other people on this forum.

Thanks,

Ronald

1 post - 1 participant

Read full topic

My first app with capacitor, build using shell script

$
0
0

Hi all, I always used cordova engine but now i’d like to migrate at capacitor.

I created my first project but I have some problem.

I have enabled the android platform and I want to create the aab file to upload to the google play console.

ionic cap build android --prod

The command completed succcessfully but then It open Android Studio Tool and show this message:

To continue, build your project using Android Studio!

In the ionic/cordova applications I created some shell scripts that allow me to quickly generate the aab file and sign it. then I manually upload the file to the developer console.

My “windows” old cordova script was similar to:

Building
ionic cordova build android --prod --release -- -- --packageType=bundle

Signing

> jarsigner -verbose -sigalg SHA1withRSA -storepass ****** -digestalg SHA1 -keystore %cert_path% %dir%\app-release.aab ****

> %build_tools_path%\zipalign -v 4 %dir%\app-release.aab %dir%\%bundle%-%vers%.aab

File created into platforms\android\app\build\outputs\bundle\release folder

If possible to use the same approach with capacitor?

Thanks

1 post - 1 participant

Read full topic


Clear app data on update

$
0
0

Hi, I need to clear(equivalent to Clear Data in App Settings) all the old data in the app programmatically when the user updates the app from Google Play Store or any other sources. This is because I don’t need any of the existing data from the old app since I have changed alot and want to reset all connections

Though i’ve to uninstall the app to get it work, cus my scanner dont search my database, maybe its somehow not updates itself?

I made an startup function for checking if application was update how should i grasp it, this clear data

Any Suggestions?

1 post - 1 participant

Read full topic

Capacitor app crash on start

$
0
0

Hi all,
I created my first app. I uploaded package on my Google Developer Console in order to install it on my device but when I open app, it crash.

In logcat I read:

Unable to instantiate activity ComponentInfo{it.mgdlab.app.hellocapacitor/it.mgdlab.app.hellocapacitor.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "it.mgdlab.app.hellocapacitor.MainActivity" on path: DexPathList[[zip file "XXlib/arm /system/lib /system_ext/lib]]

How can I solve the issue?

1 post - 1 participant

Read full topic

Ionic Vuejs w

$
0
0

Hello Everyone,

I am new to Ionic vuejs, I have developed an Ionic vuejs project without typescript and just js, and now I want to deploy this project to the FTP server. I did run an ionic build and can see the dist folder and inside contents of it. My question is that I am also using Tomcat which is on the same FTP server, where my Springboot backend is deployed. So, I need to understand where I should place the contents of the dist folder on the server, and if there are any changes to be done in index.html or any changes to be done in any file in the dist folder before deploying it to the server and how to access the project when deployed, can anyone share some doc or sample project sort of thing to help me understand better with the steps of deployment.

I appreciate it, thanks.

I have followed the https://www.youtube.com/watch?v=mQ4zmFy4d7Y&pp=ygULaW9uaWMgdnVlanM%3D video for the initial setup.

1 post - 1 participant

Read full topic

Ionic Angular Tutorial: Firebase Realtime CRUD Mobile App

How can I move vertically a PopoverController

$
0
0

In my application, I use a button to display a popover from another page.

The popover is centered both horizontally and vertically in the window, which causes it to extend beyond the window if it is too tall.

Is there a way to better adjust the vertical position of the popover?

I have tried using the properties popover.side, popover.alignment, popover.reference, and popover.keepContentsMounted, but I have not seen any change in behavior.

This is the code for the button

async columnSelect() {
    const popover = await this.popoverController.create({
      component: ColumnSelectComponent,
      componentProps: {
        columns: this.columns,
        allColumns: this.allColums,
      },
      backdropDismiss: true,
      translucent: true,
    });
    popover.style.cssText = '--min-width: 300px;';
    await popover.present();
    await popover.onWillDismiss();
    this.columns = this.varServ.popoverValue;
  }

This is the css for the popover

.sc-ion-select-popover {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  --inner-border-width: 0;
}
ion-popover .popover-viewport {
  display: contents;
}
.popover-viewport .popover-content {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

This is how the popover is show

3 posts - 2 participants

Read full topic

Viewing all 70904 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>