Ionic native barcodescanner not working in Android - ionic-framework

I have ionic project scanning barcode, Im using #ionic-native/barcode-scanner it works fine on iOS, but in android when I call the scan method, the camera is opening and when it catch the barcode the apps crash and go to the root page (login). Im using LG Nexus android 6.0, can anyone help me please!
this.barcodeScanner.scan().then((data) => {
this.addProduct(data.text);
}, (err) => {
console.log(err);
});
Ionic:
ionic (Ionic CLI) : 4.0.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2 #ionic/app-scripts :
3.1.10
Cordova:
cordova (Cordova CLI) : 7.1.0 Cordova Platforms : android
7.1.1, browser 5.0.3, ios 4.5.5
System:
ios-deploy : 1.9.2 NodeJS : v6.10.0 (/usr/local/bin/node)
npm : 6.2.0 OS : macOS High Sierra Xcode :
Xcode 9.4.1 Build version 9F2000

I have added onPauseSubscription in app.component so when I call the barcode scanner it calls this event automatically in android only. I removed it and it is working now.
this.onPauseSubscription = platform.pause.subscribe(() => {
console.log('onPauseSubscription'); // 30 sn
this.logout();
});

Related

Why ionic APK for android is generating under the build/outputs/apki/debug/ folder and its not opening in device?

I am building a android APK normally it will generate inside output/apk/ folder but now its generating inside output/apk/debug folder, So my problem is when I install this generated APK in device it's not opening why ?
My ionic info :
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.11.0
npm : 5.6.0
OS : Windows 7

Unable to clear badge count from settings clear data in Ionic3

I am facing issues for badge plugin .
From settings screen open application -> application info -> clear data
After that on app icon badge count is still displayed.
this.Subscription = Observable.interval(5000)
.subscribe((val) => {
this.badge.set(15);
});
Plugin info
"dependencies": {
"#ionic-native/badge": "^4.20.0",
"cordova-plugin-badge": "0.8.8",
}
ionic info
Ionic:
ionic (Ionic CLI) : 4.1.2
Ionic Framework : ionic-angular 3.8.0
#ionic/app-scripts : 3.0.1
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 6.3.0
Cordova Plugins : no whitelisted plugins (14 plugins total)
System:
Android SDK Tools : 26.1.1 (
NodeJS : v8.11.2
npm : 6.9.0
OS : Windows 10

Code changes are not reflected after running the app on ios device

I'm working on a mobile app using ionic v4 and my problem is when I try to debug the app on my device I can't see the changes which I did in the file 'app.component.html'(this problem is only for this file)
I'm using vscode for coding and xCode 10 to debug the app on my device
ionic info
Ionic:
ionic (Ionic CLI) : 4.11.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.0.1
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.3.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 10 other plugins)
System:
ios-deploy : 1.9.4
NodeJS : v11.10.1 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

Ionic 3 missing ionic starter folder in platforms folder

Tried to run ionic cordova platform add android#6.3.0 latest ionic version and do not why but the platforms\android\src\io\ionic\starter folder is missing where MainActivity.java is located
Tried reinstalling a new ionic version but still misses. I am installing specific 6.3.0 android version which was working perfectly fine in my previous build, so not sure why its missing the starter folder
Ionic info details below
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 6.5.0
local packages:
#ionic/app-scripts : 3.1.10
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v6.11.3
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\Oreo\AppData\Local\Android\sdk\
Misc:
backend : pro
Main Activity java can be found in below location
.. \platforms\android\app\src\main\java\com\...
Why do you need this file? If you are building an app, APK can be found in below path
platforms\android\app\build\outputs\apk\release

IONIC --APP stuck on splash screen when using –prod (IOS 10 or lowe)

The app works fine in both android and ios (11.3 or hight), when I used to run the app using commands:
ionic cordova build ios
But as soon as I run the app using ‘–prod’ in front of them the app used to get stuck on my splash
My ionic info prints this:
cli 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.1.8
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v8.10.0
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
I got this in my safari debugger. Maybe this would help you out…!
enter image description here
I run on IOS 11.3 no problem, but with IOS 10 or lower and using flag “–prod” then error.