Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

Android 10 Camera Plugin Issues

$
0
0

I found another Android 10 device with a different manufacturer, and on that device, the above code works correctly. The fundamental difference appears to be that the first device (Motorola) never keeps the activity when it switches to the camera. The second device (Samsung) does keep the activity.

I went back to my Android 7 device, and to the Samsung Android 10 device. On both, I updated the developer settings so that activities are never kept. Now all three fail.

The problem seems to be in the flow from the Camera activity back to my activity. In capacitor-android/BridgeActivity.java, in the onActivityResult method, data is always null and resultCode is always -1.

This leads me to suspect that there is something in the way that CameraPlugin is launching the Camera Activity that only works when the parent Activity remains alive.

The LogCat isn’t especially helpful here, but one thing I noted is that just prior to the call to processCameraImage, I see this message:

D/Capacitor: Unable to find a Capacitor plugin to handle requestCode, trying Cordova plugins 1401879998

Where 1401879998 is the requestCode (and -1 is the resultCode).


Ionic-capacitor v3.1.2 unknown option ‘–npm-client’

$
0
0

just update @ionic/cli to the latest version available (6.17.0 at the moment)

Axios API calls not working on iOS

$
0
0

For iOS you need to configure your server to allow CORS from capacitor://localhost

Installing the LESS CSS Preprocessor

$
0
0

Is there an easy way to integrate the LESS CSS Preprocessor with my Component development?

When I tried to install LESS, I got this:

imaginativeone@Dougs-MacBook-2 vue-paradeto % npm install less less-loader --save-dev

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: **vue-paradeto** @ **0.0.1**
npm ERR! Found: **webpack** @ **4.46.0**
npm ERR! node_modules/webpack
npm ERR! peer **webpack** @" **^4.0.0** " from **@intervolga/optimize-cssnano-plugin** @ **1.0.6**
npm ERR! node_modules/@intervolga/optimize-cssnano-plugin
npm ERR! **@intervolga/optimize-cssnano-plugin** @" **^1.0.5** " from **@vue/cli-service** @ **4.5.13**
npm ERR! node_modules/@vue/cli-service
npm ERR! peer **@vue/cli-service** @" **^3.0.0 || ^4.0.0-0** " from **@vue/cli-plugin-babel** @ **4.5.13**
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev **@vue/cli-plugin-babel** @" **~4.5.0** " from the root project
npm ERR! 7 more (@vue/cli-plugin-e2e-cypress, @vue/cli-plugin-eslint, ...)
npm ERR! peer **webpack** @" **^4.0.0 || ^5.0.0** " from **@soda/friendly-errors-webpack-plugin** @ **1.8.0**
npm ERR! node_modules/@soda/friendly-errors-webpack-plugin
npm ERR! **@soda/friendly-errors-webpack-plugin** @" **^1.7.1** " from **@vue/cli-service** @ **4.5.13**
npm ERR! node_modules/@vue/cli-service
npm ERR! peer **@vue/cli-service** @" **^3.0.0 || ^4.0.0-0** " from **@vue/cli-plugin-babel** @ **4.5.13**
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev **@vue/cli-plugin-babel** @" **~4.5.0** " from the root project
npm ERR! 7 more (@vue/cli-plugin-e2e-cypress, @vue/cli-plugin-eslint, ...)
npm ERR! 20 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev **less-loader** @" ***** " from the root project
npm ERR!
npm ERR! Conflicting peer dependency: **webpack** @ **5.51.1**
npm ERR! node_modules/webpack
npm ERR! peer **webpack** @" **^5.0.0** " from **less-loader** @ **10.0.1**
npm ERR! node_modules/less-loader
npm ERR! dev **less-loader** @" ***** " from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/imaginativeone/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/imaginativeone/.npm/_logs/2021-08-27T15_17_11_089Z-debug.log

Debugging published android app whitescreen

$
0
0

You cannot debug a live app. It seems weird that android’s system didn’t catch this error, it usually does. Maybe you can contact the ionic team since you are using appflow and they can point you in the right direction.

Streaming-media play video in div instead of full screen

$
0
0

You can play .m3u8 files in a video. They are just a list of different video files that can be played back.

Ionic React: Going back IonTabs to another IonTabs error

$
0
0

I’m pretty sure it’s the switch statements, which control if a component should be in the DOM. Typically with Ionic’s routing, you don’t use this as we want the components to be in the DOM for faster back navigation.

Thought I think you should really reconsider this. As it’s pretty bad for UX to have multiple sets of tabs. As a user, I wouldn’t know what is “Home” more or less. Plus, other major apps that exist do not use this approach as well.

Installing the LESS CSS Preprocessor

$
0
0

Hmm, haven’t used Less in a long time, is it still being maintained?
Anyways, the output is telling you how to move forward…

npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

But it’s more likely an issue with less/less-loader. Might want to not use it


Installing the LESS CSS Preprocessor

$
0
0

You’re probably right. Would you point me in the direction of an Ionic template that has a CSS Preprocessor that works?

React + Ionic 5 and routing

$
0
0

I’ve read the documentation again and I realized that it’s not recommended to use IonRouterOutlet inside IonRouterOutlet. That could be the cause? If so, how would you implement a scenario where you have x pages without tabs and some other pages with tabs?

Ionic-capacitor v3.1.2 unknown option ‘–npm-client’

$
0
0

Although I don’t want to get in the way of @jcesarmobile’s excellent advice, I think it’s worth mentioning again that if you don’t want to be constantly running the risk of banging into incompatibilities, always stick to using LTS node versions.

Ionic 5 and nested array

$
0
0

Every iteration of this loop assigns the exact same thing to arrayTwoModified, so all of your arrayTwoModifieds alias the same object. That explains:

IONIC bytes array to binary base64

$
0
0

Your topic says “base64”. The question in your post does not. What do you mean by “bytes to binary”?

GeoLocation returns "Location Unavailable" for Android 11

$
0
0

I have an application Ionic Capacitor Angular that is simply getting the GeoLocation and displaying the lat lng on screen

async ngOnInit(){
    await Geolocation.getCurrentPosition({
      enableHighAccuracy: true
    }).then((resp) => {
      this.latitude = resp.coords.latitude;
      this.longitude = resp.coords.longitude;

      this.options = {
        center: { lat: this.latitude, lng: this.longitude},
        zoom: 17
      };  
    }).catch((error) => {
      console.log('Error getting location', error);
    });      
  }

This runs perfectly fine in the browser with Ionic Serve. I have also successfully launched it on a device(Samsung S9) which is Android V9 (knox api level 27). However when I run it on a (Samsung S21 Ultra) which is Android V11 (knox api level 33)

I have the following within the AndroidManfiest.xml of the app

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-feature android:name="android.hardware.location.gps" />

I see this in the documentation

Caution: If your app targets Android 11 (API level 30) or higher, the system enforces this best practice [ *asking for foreground and background access in separate requests* ]. If you request a foreground location permission and the background location permission at the same time, the system ignores the request and doesn’t grant your app either permission

I have not been able to find a resolution to this issue. Can someone please help provide some insight. Again this is actual hardware and not an emulator.

Ion-select does not show selected option when value is an object type

$
0
0

Hi Guys,

I am having this same issue with ionic-vue. Any idea how to solve it ?


Ion-select with list of objects

$
0
0

Hi Guys,

I am having this same issue with ionicV5-vue . I would like to know how to solve it ?

Ion-select does not show selected option when value is an object type

$
0
0

I’ve never used Vue, but JavaScript is JavaScript. Have you read all the threads linked to in here?

GeoLocation returns "Location Unavailable" for Android 11

Ionic-capacitor v3.1.2 unknown option ‘–npm-client’

$
0
0

Yeah, that’s a good advice too, I’m using version 15 and a lot of commands “yell” at me for using an uneven version.

In this case the problem is that capacitor 3 removed the -npm-client param and old versions of ionic/cli passed it, so need to update the CLI version so it doesn’t pass the param anymore

Ion-select does not show selected option when value is an object type

$
0
0

Hi @rapropos,

On ion-select docs, I noticed just for react, there is an example using comparewith.

        <IonLabel>Users</IonLabel>
            <IonSelect compareWith={compareWith} value={selectedUsers} multiple onIonChange={e => setSelectedUsers(e.detail.value)}>
              {users.map(user => (
                <IonSelectOption key={user.id} value={user}>
                  {user.first} {user.last}
                </IonSelectOption>
              ))}

This is what I was looking for. It works for vue too.

Tks

Viewing all 228535 articles
Browse latest View live


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