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

Capacitor ios live reload?

$
0
0

Yes, it should be :grinning:. Added it here.

Note that for Ionic CLI v5.0 (latest version as of June 2019), the command is:

ionic capacitor run ios -l --address=0.0.0.0

Android dev builds on API 28/29 show ERR_CLEARTEXT_NOT_PERMITTED

$
0
0

Are you using Capacitor or Cordova? You posted in the capacitor category, yet you’re running cordova commands.

IONIC 4 - com.android.ide.common.process.ProcessException: Failed to execute aapt

$
0
0

Even if I reverse my modifications to the master, I get this error …
As if I had updated something in the meantime …

How to use Capacitor's convertFileSrc() instead of Cordova's convertFileSrc()?

$
0
0

Import Capacitor from @capacitor/core:

import { Capacitor } from '@capacitor/core';

and use it like this:

Capacitor.convertFileSrc('file:///your/file/path');

Android dev builds on API 28/29 show ERR_CLEARTEXT_NOT_PERMITTED

$
0
0

If you are using cordova add a config tag in your config.xml. Something along the lines of

<edit-config target="AndroidManifest.xml" parent="/manifest">
    <application  android:usesCleartextTraffic="true" mode="merge">
</edit-config>

If you’re using Capacitor then a) don’t run cordova commands in it and b) Capacitor shouldn’t be overwriting any Android files in the firest place.

Ionic 4: create reusable alert controller component with data submit

$
0
0

Hello everyone, i need a little help to build a alert controller reusable component where i want to use handler to submit data, i have 2 functions for insert and edit data, and im using the alert controller handler to archieve this process but i dont know how to pass objects to reuse same code for all my cruds, here are the 2 functions i want to use as service for all my others pages:

Insert data:

async insertarData() {
const alert = await this.uiService.alertController.create({
header: ‘Agregar nueva actividad’,
inputs: [
{
name: ‘nombreActividad’,
type: ‘text’,
placeholder: ‘Ingrese actividad’
}
],
buttons: [
{
text: ‘Cancel’,
role: ‘cancel’,
cssClass: ‘secondary’
}, {
text: ‘Crear’,
handler: data => {
this.actividad.nombreActividad = data[‘nombreActividad’];
this.crearActividad();
}
}
]
});

await alert.present();

}

Edit data:

async editarActividad(){

  const alert = await this.uiService.alertController.create({
    header: 'Agregar nueva actividad',
    inputs: [
      {
        name: 'nombreActividad',
        value: this.actividad.nombreActividad ,
        type: 'text',
        placeholder: 'Ingrese actividad'
      }
    ],
    buttons: [
      {
        text: 'Cancel',
        role: 'cancel',
        cssClass: 'secondary'
      }, {
        text: 'Crear',
        handler: data => {
          this.actividad.nombreActividad = data['nombreActividad'];
           this.actividadService.actualizarPorId(this.actividad.id, this.actividad.nombreActividad).subscribe(
           res => this.uiService.presentToast(res['message']),
           error => this.uiService.alertaInformativa(error)
           );        
        }
      }
    ]
  });

  await alert.present();
}

every comment and advice are totally welcome.

thanks in advance.

Having a nightmare with button taps

$
0
0

Hi All,

I’ve been having a nightmare implementing a PIN entry UI. The nightmare is that button clicks/presses/taps/tapables dont always register, especially if you are trying to type in your PIN really quickly. I’ve even got rid of all the buttons and replaced them with tappable divs.

Has anyone had any problems with multiple buttons on one page, and with quick button presses you miss button actions on some of them?

How to use Capacitor's convertFileSrc() instead of Cordova's convertFileSrc()?

$
0
0

Thanks! This is not documented anywhere in the Capacitor docs, as far as I can tell.

But, I guess it is documented here, now… :slight_smile:


Upload image to database using file_uri

$
0
0

In your code above, you are just trying to get the image to upload, but you did not add the post request to upload. Please post your full code, so people can help you

Capacitor plugin for MongoDB Mobile

$
0
0

Hey all,

Just wanted to let people know I’ve created a capacitor plugin for MongoDB mobile; it should have all the features of mongodb except for server-side javascript (map/reduce, $where queries) and things related to replicasets, etc, which aren’t really relevant to mobile use.

The plugin itself is at https://www.npmjs.com/package/@hamstudy/capacitor-mongodb-mobile and I’ve created a wrapper at https://www.npmjs.com/package/@hamstudy/mongodb-mobile-client which works with the plugin and gives you the same API (promise-based only, no callbacks) as the 3.x node driver.

I’d call this still beta quality as I haven’t had time to write tests for all of the APIs yet but I have written a simple project with tests which pass on both ios and android, so I think anything else not working should be fixable when I find out what the issues are and get some repro cases written for it.

The tests are in this project: https://github.com/HamStudy/capacitor-mongodb-mobile-testApp

Ionic CSS Parameter

$
0
0

How I make it right?
I want the variable to be passed to CSS.

At the moment it was hard coded. But I want it to use the colors it gets from the database.
grafik
grafik

"export 'ICON_PATHS' was not found in 'ionicons/icons'

$
0
0

I’m getting the same error, with the template not loading. However I’m not using yarn/don’t have the yarn.lock file.

Any thoughts?

Inoic support on couchbaselite plugin

$
0
0

Hi,

In couchbase-lite native plugin documentation noticed a notification saying “This plugin is no longer supported by Couchbase. Please see our Couchbase Lite Integration”. Is this means couchbase lite plugin is no longer supported in community edition?

ERR_SDK_NOT_FOUND: No valid Android SKD root found

$
0
0

Hello people.
I’m working on a project with Ionic V4 for the first time. I want to run my app on an emulator and it keeps giving this error:
ERR_SDK_NOT_FOUND: No valid Android SDK root found.

I’ve tried running with various commands: native-run android, ionic cordova run android, ionic cordova run android --no-native-run, ionic run android but they all give the same error.

I ran ionic cordova requirements and I have all requirements (JDK, SDK, gradle) installed.
I need help with this and will appreciate any/all suggestions as this is quite urgent.

Background running and variables

$
0
0

Hi all. I need help.

Something is not evident to me about scope of variables in typescript.

I have an app that goes in background, and with a timer has to check a condition. But with setInterval
I can’t pass a value to the function, and the function can’t access the foreground environment (I guess).

Example (I hope I didn’t big error, this s a not tested code):

export class HomePage {
value: string

constructor(
    private alertCtrl: AlertController,t,
    private platform: Platform
  ) {
        this.value = "something";
        setInterval(this.test, 1000);
  }

test() { 
       console.log(this.value)
}

console show undefined. Why??

Any help will be appreciated.


Background running and variables

$
0
0

This is one of the extremely poor design decisions of JavaScript. The main heuristic I use to avoid problems like you are seeing is “never type the word function inside of one”, and your situation is a cousin of that. In C++, the compiler would throw an error until you made test a static method, at which point it would become obvious to you that you can’t access member variables. JavaScript, on the other hand, decided it would be a better idea to silently make the construct do something nobody would ever expect or want. Your best tool here is the arrow function:

setInterval(() => this.test(), 1000);

Ionic HTTPS

$
0
0

Interaction with “the server” is usually done with HttpClient, where you are completely in control of URL construction (and yes, HTTPS works just fine).

Additionally, Ionic apps use HTTP internally to fetch their code and assets, but in that case the “server” is really a part of the app itself, on device, so that shouldn’t be a concern.

Ionic Build Android not work

$
0
0

I am trying to make my application work with ionic 3, when I do the construction it gives me error, additional that node_modules does not work correctly and in each construction it delivers different errors

Android Studio project detected

ANDROID_HOME=/usr/local/Caskroom/android-platform-tools/28.0.1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
studio
Subproject Path: CordovaLib
Subproject Path: app
(node:1017) UnhandledPromiseRejectionWarning: Error: spawn EACCES
at ChildProcess.spawn (internal/child_process.js:313:11)
at Object.exports.spawn (child_process.js:508:9)
at exports.spawn (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
at StudioBuilder.build (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/lib/builders/StudioBuilder.js:249:12)
at /Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/lib/build.js:159:24
at _fulfilled (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/q/q.js:624:44
at runSingle (/Users/user/Desktop/app-henkel/myApp/platforms/android/cordova/node_modules/q/q.js:137:13)
(node:1017) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1017) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.2.2
    Cordova Platforms  : android 7.0.0 browser 5.0.4 ios 4.5.5
    Ionic Framework    : ionic-angular 3.9.5

System:

    Node  : v8.15.0
    npm   : 6.4.1
    OS    : macOS
    Xcode : Xcode 10.2.1 Build version 10E1001

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

Build Break with aapt error message . why?

$
0
0

Failed to install ‘cordova-android-support-gradle-release’: Error: /Users/user/Desktop/home-made-app 3/platforms/android/gradlew: Command failed with exit code 1
at ChildProcess.whenDone (/Users/user/Desktop/home-made-app 3/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

Ionic 4 App Not Loading Past Spash Screen On iOS

$
0
0

I am building an app which runs great on Android. I have recently been trying to get the app to run on iOS. The app builds, but never runs past the splash screen. (The splash screen disappears, but the screen goes completely white and stays that way.) There are no errors, and the console logs inside the constructor of the app.component.ts file are not shown in the console when remote debugging through Safari.

This is the entire log that I see in XCode:

2019-07-01 19:52:54.087061-0500 PartyMe[5971:140222] Apache Cordova native platform version 4.5.5 is starting.
2019-07-01 19:52:54.087917-0500 PartyMe[5971:140222] Multi-tasking -> Device: YES, App: YES
2019-07-01 19:52:54.231658-0500 PartyMe[5971:140222] [MC] Lazy loading NSBundle MobileCoreServices.framework
2019-07-01 19:52:54.233010-0500 PartyMe[5971:140222] [MC] Loaded MobileCoreServices.framework
2019-07-01 19:52:54.234709-0500 PartyMe[5971:140222] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/tristan/Library/Developer/CoreSimulator/Devices/A3B7A939-B669-40A5-906A-8F389D1148E9/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2019-07-01 19:52:54.240366-0500 PartyMe[5971:140222] Using UIWebView
2019-07-01 19:52:54.243144-0500 PartyMe[5971:140222] [CDVTimer][console] 0.074029ms
2019-07-01 19:52:54.243364-0500 PartyMe[5971:140222] [CDVTimer][handleopenurl] 0.078917ms
2019-07-01 19:52:54.245225-0500 PartyMe[5971:140222] [CDVTimer][intentandnavigationfilter] 1.726031ms
2019-07-01 19:52:54.245442-0500 PartyMe[5971:140222] [CDVTimer][gesturehandler] 0.073075ms
2019-07-01 19:52:54.245564-0500 PartyMe[5971:140222] [CDVTimer][TotalPluginStartup] 2.563000ms
2019-07-01 19:52:54.258490-0500 PartyMe[5971:140222] DidFinishLaunchingWithOptions
2019-07-01 19:52:54.275: <FIRMessaging/INFO> FIRMessaging library version 1.2.0
2019-07-01 19:52:54.286446-0500 PartyMe[5971:140300] [Firebase/Core][I-COR000001] Configuring the default app.
2019-07-01 19:52:54.286 PartyMe[5971] <Debug> [Firebase/Core][I-COR000001] Configuring the default app.
2019-07-01 19:52:54.288233-0500 PartyMe[5971:140305] <FIRAnalytics/INFO> Firebase Analytics v.3403000 started
2019-07-01 19:52:54.293: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2019-07-01 19:52:54.293: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"
2019-07-01 19:52:54.296: <FIRMessaging/WARNING> FIRMessaging AppDelegate proxy enabled, will swizzle app delegate remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2019-07-01 19:52:54.289 PartyMe[5971:] <FIRAnalytics/INFO> Firebase Analytics v.3403000 started
2019-07-01 19:52:54.301666-0500 PartyMe[5971:140305] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/Y0Yjwu)
2019-07-01 19:52:54.303 PartyMe[5971:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/Y0Yjwu)
2019-07-01 19:52:54.315: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator}
2019-07-01 19:52:54.318478-0500 PartyMe[5971:140222] app become active
2019-07-01 19:52:54.537283-0500 PartyMe[5971:140305] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1757 received sct extension length is less than sct data length
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 5971, TID: 140299, Thread name: (none), Queue name: FIRAnalyticsQueue, QoS: 9
Backtrace:
4   PartyMe                             0x0000000106cc93d6 __38+[FIRAnalytics createAppDelegateProxy]_block_invoke + 53
5   libdispatch.dylib                   0x000000010b71f43c _dispatch_client_callout + 8
6   libdispatch.dylib                   0x000000010b7209c7 dispatch_once_f + 297
7   PartyMe                             0x0000000106cc83d0 __47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 101
8   libdispatch.dylib                   0x000000010b71e3f7 _dispatch_call_block_and_release + 12
9   libdispatch.dylib                   0x000000010b71f43c _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010b72795b _dispatch_queue_serial_drain + 1162
11  libdispatch.dylib                   0x000000010b7282df _dispatch_queue_invoke + 336
12  libdispatch.dylib                   0x000000010b72b1f9 _dispatch_root_queue_drain + 772
13  libdispatch.dylib                   0x000000010b72ae97 _dispatch_worker_thread3 + 132
14  libsystem_pthread.dylib             0x000000010bbea6ee _pthread_wqthread + 619
15  libsystem_pthread.dylib             0x000000010bbea415 start_wqthread + 13
2019-07-01 19:52:54.718564-0500 PartyMe[5971:140299] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 5971, TID: 140299, Thread name: (none), Queue name: FIRAnalyticsQueue, QoS: 9
Backtrace:
4   PartyMe                             0x0000000106cc93d6 __38+[FIRAnalytics createAppDelegateProxy]_block_invoke + 53
5   libdispatch.dylib                   0x000000010b71f43c _dispatch_client_callout + 8
6   libdispatch.dylib                   0x000000010b7209c7 dispatch_once_f + 297
7   PartyMe                             0x0000000106cc83d0 __47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 101
8   libdispatch.dylib                   0x000000010b71e3f7 _dispatch_call_block_and_release + 12
9   libdispatch.dylib                   0x000000010b71f43c _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010b72795b _dispatch_queue_serial_drain + 1162
11  libdispatch.dylib                   0x000000010b7282df _dispatch_queue_invoke + 336
12  libdispatch.dylib                   0x000000010b72b1f9 _dispatch_root_queue_drain + 772
13  libdispatch.dylib                   0x000000010b72ae97 _dispatch_worker_thread3 + 132
14  libsystem_pthread.dylib             0x000000010bbea6ee _pthread_wqthread + 619
15  libsystem_pthread.dylib             0x000000010bbea415 start_wqthread + 13
2019-07-01 19:52:54.795224-0500 PartyMe[5971:140222] Resetting plugins due to page load.
2019-07-01 19:52:54.799318-0500 PartyMe[5971:140300] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2019-07-01 19:52:54.799 PartyMe[5971:] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2019-07-01 19:52:54.843018-0500 PartyMe[5971:140326] [Firebase/Core][I-COR000019] Clearcut post completed.
2019-07-01 19:52:54.847 PartyMe[5971] <Debug> [Firebase/Core][I-COR000019] Clearcut post completed.
2019-07-01 19:52:54.849376-0500 PartyMe[5971:140299] TIC Read Status [1:0x0]: 1:57
2019-07-01 19:52:54.849532-0500 PartyMe[5971:140299] TIC Read Status [1:0x0]: 1:57
2019-07-01 19:52:54.974676-0500 PartyMe[5971:140222] Connected to FCM.
2019-07-01 19:52:55.541531-0500 PartyMe[5971:140326] <FIRAnalytics/INFO> Firebase Analytics enabled
2019-07-01 19:52:55.541 PartyMe[5971:] <FIRAnalytics/INFO> Firebase Analytics enabled
2019-07-01 19:52:55.668442-0500 PartyMe[5971:140222] Finished load of: file:///Users/tristan/Library/Developer/CoreSimulator/Devices/A3B7A939-B669-40A5-906A-8F389D1148E9/data/Containers/Bundle/Application/3DB3DE6B-AD42-4C9E-992E-3F54F1A87B75/PartyMe.app/www/index.html
2019-07-01 19:52:55.676892-0500 PartyMe[5971:140222] Cordova view ready
2019-07-01 19:52:55.682611-0500 PartyMe[5971:140222] FCMPlugin.js: is created
2019-07-01 19:52:55.682768-0500 PartyMe[5971:140222] FCMPlugin Ready OK

XCode Version: 10.1
Ionic Version: 5.2.0
Cordova Version: 8.1.2

The same behavior is seen in the simulator as well as on a physical device. This is getting extremely frustrating. I should note that I have also run into build issues such as the GoogleService-Info.plist being copied twice from the bundle resources, and having to change the base href in the app’s index.html file from “/” to “./”.

Any help is appreciated.

Viewing all 228529 articles
Browse latest View live


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