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

Error building an android apk -TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf ()

$
0
0

@umsuka wrote:

Hi

I would like assitance with this error if anyone has seen it before.

I am trying to run ionic cordova build android --prod and its giving me this error

[13:55:15]  build prod started ...
[13:55:16]  clean started ...
[13:55:16]  clean finished in 10 ms
[13:55:16]  copy started ...
[13:55:17]  deeplinks started ...
[13:55:18]  deeplinks finished in 300 ms
[13:55:18]  ngc started ...
TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at Object.__extends (C:\mydir\node_modules\tslib\tslib.js:64:9)
    at C:\MobileApps2019\MUFSASFINAL\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:115:17
    at C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:314:6
    at Object.defineProperty.value (C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:3:17)
    at Object.<anonymous> (C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:9:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

Here is my ionic info data

cli packages: (C:\Users\admin\AppData\Roaming\npm\node_modules)

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

global packages:

    cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)

local packages:

    @ionic/app-scripts : 3.2.4
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.11.3
    npm               : 6.10.2
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\admin\AppData\Local\Android\Sdk

Misc:

Posts: 1

Participants: 1

Read full topic


Ionic app doesn't access internet on android pie devices

$
0
0

@niranjan-oss wrote:

Cordova -v = 9.0.0
Ionic -v = 5.2.3

I just created an android application. It works well in below android 8 versions. The problem is in android pie devices. applications starts well. It didn’t connect with a backend. Both devices are in same private network. any ideas?

Posts: 1

Participants: 1

Read full topic

An error occurred while running subprocess cordova_Native-run

Error: null is not an object (evaluating 'ref.addEventListener')

$
0
0

@Harikag wrote:

Facing below issue for document.addEventListener ();
Error: null is not an object (evaluating ‘ref.addEventListener’)

But same is working for Android and Emulator but not for ios and simulator.

So please help me

Posts: 1

Participants: 1

Read full topic

Split up build steps

$
0
0

@dsb-xkrdu wrote:

I am looking to split the build of an Ionic 1 app up into two steps:

  1. Build everything possible on a Linux machine, and
  2. Build the final package on a mac with xcode installed.

What I am really hoping is that it will be possible to run step #2 on a machine that doesn’t have ionic or cordova or anything installed. It’s not completely clear to me what the build steps are and whether this is possible or not. For the record, I am using Fastlane as well.

I have this problem with another app as well, which is using Ionic 3.

Can anyone guide me in the right direction or tell me whether this is possible or not?

Posts: 1

Participants: 1

Read full topic

App crash when accessing camera in android 9

$
0
0

@alucarddracula wrote:

Hi,

I am new to ionic cordova and I am having some trouble with the cordova camera plugin. I made an app to stream to my server and it works well with android 7 and below but with android 9 when I try to access the camera the app crashes then if i reopen the app it does not respond.

I have tried debugging the app using chrome developer tools but I am not able to get the error generated. Has anyone else had trouble with camera access?

If so how did you resolve it?

My app module code is:

.....
import { Camera } from '@ionic-native/camera';import { Camera } from '@ionic-native/camera';
.....

  providers: [
   ..........
    Camera,
    ........
  ]


This is my android manifest

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="50700" android:versionName="5.7" package="mobile.stream.test" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths" />
        </provider>
        <receiver android:enabled="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
            </intent-filter>
        </receiver>
    </application>
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera2.full" android:required="false" />
    <uses-feature android:name="android.hardware.camera2.autofocus" android:required="false" />
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
    <permission android:name="mobile.twendesmart.com.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="mobile.twendesmart.com.permission.RECEIVE_ADM_MESSAGE" />
</manifest>

Posts: 1

Participants: 1

Read full topic

Ionic v4 render problems in Chrome OS

$
0
0

@mlynch wrote:

I’m creating a cross-platform application to run on both iOS and Android, and I’ve been testing it on a Chrome OS device as well by running the Android app in Chrome OS.

When I run the device on my Android tablet, it works perfectly, but when I run the same Android application on the Chromebook, there are a ton of rendering issues - large white spaces where elements should be displayed, no text rendering until I mouse over it (and even then only about half the letters appear). This was all working for me until about a month ago, so I’m not sure what happened. Chrome OS should be rendering the app exactly the same as Android does.

Anyone else have this issue? Any ideas for how to fix it?

Posts: 1

Participants: 1

Read full topic

Uncaught TypeError: Reflect.getMetadata is not a function

$
0
0

@kawthar1 wrote:

Hello there,

I am trying to deploy my app in the store but i am facing an error with this command:

ionic cordova run android --prod

Saying that:

Uncaught TypeError: Reflect.getMetadata is not a function
    at Function.e.add (main.0e8f6659040a9b137076.js:1)
    at main.0e8f6659040a9b137076.js:1
    at Object.s (main.0e8f6659040a9b137076.js:1)
    at Object.lGQG (main.0e8f6659040a9b137076.js:1)
    at r (runtime.631d757b4d4f5722817f.js:1)
    at Object.o0su (main.0e8f6659040a9b137076.js:1)
    at r (runtime.631d757b4d4f5722817f.js:1)
    at Module.zUnb (main.0e8f6659040a9b137076.js:1)
    at r (runtime.631d757b4d4f5722817f.js:1)
    at Object.0 (main.0e8f6659040a9b137076.js:1)

Here is my project info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : android 8.0.0, browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 14 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/ali_frad/Android/Sdk)
   NodeJS            : v10.15.3 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : Linux 4.4

I really can’t figure out what is the reason the app works fine in debug version
Please can anyone help me i uergently need to put the app in the store
Thanks in advance :slight_smile:

Posts: 1

Participants: 1

Read full topic


Implement searching bar in Ionic 4

$
0
0

@aligassan wrote:

I am fetching data from a JSON file stored locally in my project. The JSON string is an array …

[
  [
    "o:94312904",
    "الموصل",
    "city-2",
    43.129,
    36.342,
    43,
    18
  ],
  [
    "o:2482644198",
    "الشرقاط",
    "city-3",
    43.234,
    35.518,
    42,
    15
  ],
  [
    "o:2484133456",
    "ناحية القيارة",
    "city-3",
    43.292,
    35.799,
    54,
    15
  ]
]

What i want to do , after searching on any city name . i want to pass the lat and long of city from keyPressed() to addThemFunction() even shows weather result . But when i do searching in box search he return all cities names array ! not elements that match the search criteria .

Code :

  search:any

  obs: any;

    keyPressed(event: any) { 

      console.log(event.target.value); 

      let val = event.target.value;

      if (val && val.trim() !== '') {
        return this.searchin(val);
      }

    }

    searchin(search){
      this.searching.get('./assets/ali.json').subscribe((data) => {

        this.search = data
        console.log(this.search)
      })

    }

      async addThemFunction(search){

        this.http.get("/json&geocode="+search[3]+","+search[4]+"&language=ar-OM&units=m"
        , {}, {})
        .then(data => {

          this.obs = JSON.parse(data.data).vt1observation


          }), err=>{
          }
        }

Html

  <ion-searchbar type="text" debounce="500" (ionInput)="keyPressed($event)"></ion-searchbar>
  <ion-list >
    <ion-item *ngFor="let item of search">
      {{ item[1]}}
    </ion-item>
  </ion-list>

any idea please ?

Posts: 1

Participants: 1

Read full topic

Ionic 4 ngOnDestroy not called from component on page navigation

$
0
0

@BrentAshWilliams wrote:

Hello,

I have an ionic 4 app. I am using angular routing.

I have a page with a number of @Components on it.

In one component I want ngOnDestroy called when navigating to another page.

In my app.component.ts I have a menu which I can chose which page to navigate to.

this.router.navigate([page.url]);

When I navigate from the page with the component that has the ngOnDestroy( ), ngOnDestroy( ) is not called.

Any ideas what I am doing wrong?

Thanks

Posts: 1

Participants: 1

Read full topic

Run iOS from CLI works fine, but error running in XCode

$
0
0

@obinnae wrote:

Yo! If I run the following from the terminal…

ionic cordova run ios --prod --address=0.0.0.0 --no-native-run -lc

it works fine and opens up on the iPhone, but when I run it from XCode, it doesn’t go beyond the splash screen, and gives these errors (among others)…

[NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 “Permission denied”, descriptor: <CTServiceDescriptor 0x2825e8060, domain=1, instance=1>

HTTP load failed (error code: -999 [1:89])

Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)

Failed to load webpage with error: Could not connect to the server.

What gives?? How come it works fine via CLI, but not XCode? How can I determine what URL it’s trying to connect to? I was hoping to get it ready to submit to the app store, but with this issue, it might get rejected.

Any help would be appreciated. Thanks.

Posts: 1

Participants: 1

Read full topic

Migrating to AndroidX with new zoom 64bit lib

$
0
0

@Shay_Shaked wrote:

Hello,
We have an ionic app written in ionic 2, with custom zoom plugin we’ve created.
Problem is that starting August 1, 2019 we have to upload 64bit while updating our app.
The 64bit require us to use zoom new libraries which require us to target API 28.

We added the plugins:
ionic cordova plugin add cordova-plugin-androidx
ionic cordova plugin add cordova-plugin-androidx-adapter

While trying to run ionic build android the cmd outpot looks like this:
encrypted%20build

For some reason the outpot is encrypted, and run for hours or getting stuck without ending. build goes forever.

ionic Info:

ordova CLI: 8.1.1 (cordova-lib@8.1.0)
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.8.0
Xcode version: Not installed

Any suggestions?

Posts: 1

Participants: 1

Read full topic

Ionic start followed by ionic serve fails today

$
0
0

@VictorNorman wrote:

Today I did this:

ionic start quiz2 blank
cd quiz2
ionic serve

and I get this error:

$ ionic serve
> ng run app:serve --host=localhost --port=8100
[ng] ℹ 「wds」: Project is running at http://localhost:8100/webpack-dev-server/
[ng] ℹ 「wds」: webpack output is served from /
[ng] ℹ 「wds」: 404s will fallback to //index.html
[ng] chunk {home-home-module} home-home-module.js, home-home-module.js.map (home-home-module) 4.87 kB  [rendered]
[ng] chunk {main} main.js, main.js.map (main) 13.3 kB [initial] [rendered]
[ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 278 kB [initial] [rendered]
[ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 8.94 kB [entry] [rendered]
[ng] chunk {styles} styles.js, styles.js.map (styles) 108 kB [initial] [rendered]
[ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 4.61 MB [initial] [rendered]
[ng] Date: 2019-08-07T17:14:00.206Z - Hash: c4de417d902f37b4e786 - Time: 6119ms
[ng]
[ng] ERROR in ./node_modules/@ionic/angular/dist/fesm5.js 5823:19-33
[ng] "export 'applyPolyfills' was not found in '@ionic/core/loader'
[ng] ERROR in ./node_modules/@ionic/angular/dist/fesm5.js 5827:23-43
[ng] "export 'defineCustomElements' was not found in '@ionic/core/loader'
[ng] ERROR in ./node_modules/@ionic/core/loader/index.es2017.mjs
[ng] Module not found: Error: Can't resolve '../dist/esm/loader.mjs' in '/Users/vtn2/ionic/quiz2/node_modules/@ionic/core/loader'
[ng] ERROR in ./node_modules/@ionic/core/loader/index.es2017.mjs
[ng] Module not found: Error: Can't resolve '../dist/esm/polyfills/index.js' in '/Users/vtn2/ionic/quiz2/node_modules/@ionic/core/loader'
[ng] ERROR in ./node_modules/@ionic/angular/dist/fesm5.js
[ng] Module not found: Error: Can't resolve '@ionic/core' in '/Users/vtn2/ionic/quiz2/node_modules/@ionic/angular/dist'

My setup is:

$ ionic info

Ionic:

   Ionic CLI                     : 5.2.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.2
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v10.16.0 (/usr/local/bin/node)
   npm    : 6.10.3
   OS     : macOS Mojave

Any idea what is happening or what I do to fix it? I did this exact same thing at the end of last week and it worked fine.

Posts: 2

Participants: 1

Read full topic

Interactive map with directions in ionic

$
0
0

@JohnCressman wrote:

My boss has asked whether or not we can create an interactive map for our business campus to help visitors find what the room or department they are looking for. Basically, once inside the campus, the app would allow them to choose the department or room they wanted to visit and then give them gps style directions.

Has anyone done anything like this?

Or does anyone have any ideas on where to even start?

Posts: 1

Participants: 1

Read full topic

[Ionic 4] How to correctly refreshing the main page after returning from modal

$
0
0

@leonardofmed wrote:

I have a list of items and I have an option to add one more item to this list. I created the “add one more item” option using a modal, but when I return to the main page I have to force a refresh using document.location.reload(true); so my new added item shows in the list. The only problem that I see with this method is the loading time, taking 1 to 2 seconds to reload the page. Considering that the loaded elements are very simple, I believe that when there are more complex items this time will increase.

I see some people suggesting to use ionViewWillEnter, but I can’t see how to implement this to reload the page.

mainpage.ts (calling the modal)

async myFunction() {
	const modal = await this.modalCtrl.create({
		component: MyModalPage,
		backdropDismiss: false
	});

	let dataReturned;
	modal.onDidDismiss().then((modalData) => {
		dataReturned = modalData.data;

		// If 'saved' is returned, refresh homepage
		if (dataReturned == 'saved') {
			document.location.reload(true);
		}
	});

	return await modal.present();
}

Posts: 3

Participants: 3

Read full topic


First call of app not working http requests

$
0
0

@DanielAccorsi wrote:

On first call (when installed) or when I clear data of the app on Android devices, the http request is not working, returning unknown error. So, when I remove de app from memory (not from device) and call again the app, the http request works fine.

The http request is in app.component.ts:

this.httpProvider.getUsuario().subscribe(data => { . . . }, err => { . . . })

"getUsuario" is a function:

getUsuario(tipo, valor) {
return this.http.get(url);
}

I am using HttpClient:
import { HttpClient } from '@angular/common/http';

Can anyone help me, please??
Ionic 3

Posts: 1

Participants: 1

Read full topic

'file://' has been blocked by CORS policy. issue is present on most of the android devices

$
0
0

@PriyaS1 wrote:

Hi Team,

I am using ionic3 for my application development. I am getting below error for android application for the first time installation. Then after re launching the app is working correctly.

Access to XMLHttpRequest at ‘’ from origin ‘file://’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

software specification is:-
cordova 9.0.0
ionic 3
Android platform 8.0.0
Node 10.15.3
Angular 4
plugin list :-
cordova-plugin-camera 4.0.3 “Camera”
cordova-plugin-compat 1.2.0 “Compat”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-firebase-lib 3.3.0 “Google Firebase Plugin”
cordova-plugin-geolocation 2.4.3 “Geolocation”
cordova-plugin-inappbrowser 3.0.0 “InAppBrowser”
cordova-plugin-insomnia 4.3.0 “Insomnia (prevent screen sleep)”
cordova-plugin-ionic-keyboard 2.1.2 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.1.19 “cordova-plugin-ionic-webview”
cordova-plugin-market 1.2.0 “Market”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-screen-orientation 3.0.1 “Screen Orientation”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova.plugins.diagnostic 4.0.8 “Diagnostic”
es6-promise-plugin 4.2.2 “Promise”
info.protonet.imageresizer 0.1.1 “Image Resizer”

Solution tried:-
1. whitelist plugin restricted to 1.3.3
2. added below lines





3. checked for upgrading webview and whitelist plugin as well.
Nothing worked.

Please suggest for changes if needed. even in production build we have not done any change in Backend or frontend. But, it is happing on production old working application as well. Please help us to fix this.

Posts: 1

Participants: 1

Read full topic

*ngFor child module error

$
0
0

@Gizm0 wrote:

Hello fam,

I’m currently having a really confusing problem regarding the use of *ngFor. I have imported my CommonsModule in my child module file and I’m pretty sure my spelling and syntax is okay: *ngFor="category of loadedCategories". But right off of Visual Studio I’m getting the following error:

Property binding ngFor not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations".Angular
Can't bind to 'ngFor' since it isn't a known property of 'ion-card'.
1. If 'ion-card' is an Angular component and it has 'ngFor' input, then verify that it is part of this module.
2. If 'ion-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component

The app does finish compiling but on execution I get the same error on my devtools console. Kindly help out.

Posts: 1

Participants: 1

Read full topic

I need help to create a fake service

$
0
0

@Thiago.Lives wrote:

Hi everyone,

How can I create a fake service to return a message that depends on the phone passed in the url ?

messages = [
{ phone: ‘11113333’, message: ‘hello’ },
{ phone: ‘22223333’, message: ‘bye’ },
{ phone: ‘33334444’, message: ‘good-bye’ },
];

my url: localhost:3333/page1/33334444

I have two pages: page1 and page2. I can’t put the message on API, so I need to create a fake api service to return me the message related to each phone to show on page2.

My API is sending the id(phone) by url, I just need to know how to send the message related to each phone.

Posts: 1

Participants: 1

Read full topic

Split observable into two for segment lists

$
0
0

@obinnae wrote:

An observable contains records (each has the fields id, status, name, etc) from a Firestore collection. Some of them have status of ‘active’, and others ‘inactive’. I want to bind this collection to two ion-lists (active ones in one list, inactive in the other) with ion-segments at the top, with the buttons ‘active’ and ‘inactive’ - clicking the ‘active’ button shows the active records only, and the inactive button shows the inactive records.

How should I split the observable into two observables (active and inactive) and bind them to their corresponding lists? Is there a better way of doing this?

Thanks.

Posts: 1

Participants: 1

Read full topic

Viewing all 71530 articles
Browse latest View live


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