Appflow liveupdate don't work on my project - ionic-framework

Live update are not working on my side.
The core is developed with reactjs, built with webpack
What i did :
Add the Appflow SDK, the strings.xml is now modified
commit & push
Build the native .apk from Appflow GUI
Install the .apk on my device
Change one string in the code
Commit
Build a Web Deploy and assign it to the Production Channel
As the update method is "auto" i close the app, relaunch it, but the modified string is not updated
Any suggestion on what i could missed ?
Thanks
strings.xml
<resources>
<string name="ionic_app_id">XXXXXXXXX</string>
<string name="ionic_channel_name">Production</string>
<string name="ionic_update_method">auto</string>
</resources>
ionic info
[11:35:24]: $ ionic info
[11:35:25]: ▸ Ionic:
[11:35:25]: ▸ Ionic CLI : 6.2.2 (/usr/local/nvm/versions/node/v10.19.0/lib/node_modules/#ionic/cli)
[11:35:25]: ▸ Ionic Framework : #ionic/react 5.0.5
[11:35:25]: ▸ Capacitor:
[11:35:25]: ▸ Capacitor CLI : 1.5.1
[11:35:25]: ▸ #capacitor/core : 1.5.1
[11:35:25]: ▸ Utility:
[11:35:25]: ▸ cordova-res : 0.10.0
[11:35:25]: ▸ native-run : not installed
[11:35:25]: ▸ System:
[11:35:25]: ▸ NodeJS : v10.19.0 (/usr/local/nvm/versions/node/v10.19.0/bin/node)
[11:35:25]: ▸ npm : 6.13.4
[11:35:25]: ▸ OS : Linux 4.14

Check the case of the destination channel name. Production vs production. I believe the default values are misleading.

Related

Capacitor - Uncaught TypeError: cap.[some_function] is not a function

I just upgraded capacitor to 3.2.x and when I try to build my Ionic project, almost no capacitor function seems to work. For example, I get errors like:
Uncaught TypeError: cap.nativeCallback is not a function
...
Uncaught TypeError: Capacitor.createEvent is not a function
...
package com.getcapacitor.annotation does not exist
Here's my Ionic Info:
Ionic:
Ionic CLI : 6.17.1 (/usr/local/lib/node_modules/#ionic/cli)
Ionic Framework : #ionic/angular 5.5.2
#angular-devkit/build-angular : 0.1000.8
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 3.2.3
#capacitor/android : 3.0.0-beta.3
#capacitor/core : 3.2.3
#capacitor/ios : not installed
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 9 other plugins)
Utility:
cordova-res : 0.15.3
native-run : 1.4.1
System:
Android SDK Tools : 26.1.1 (/home/che-azeh/Android/Sdk)
NodeJS : v12.21.0 (/usr/bin/node)
npm : 7.5.2
OS : Linux 5.11
Here was the problem: if you look at the capacitor section under my Ionic Info, you'd notice an incosistency between Capacitor CLI, #capaciotr/core and #capacitor/android:
Capacitor:
Capacitor CLI : 3.2.3
#capacitor/android : 3.0.0-beta.3
#capacitor/core : 3.2.3
So what I did was upgrade all 3 to their latest versions:
npm install #capacitor/cli#latest #capacitor/core#latest
npm install #capacitor/android#latest
Now, it looks ike:
Capacitor:
Capacitor CLI : 3.2.3
#capacitor/android : 3.2.3
#capacitor/core : 3.2.3
Finally, I remove the Android folder created by capacitor (rm -R ./android), reinitialize capacitor (npx cap init) rebuild ionic project (ionic build android) and then npx cap add android.
And solved! Zero errors!

No resource found that matches the given name (at 'networkSecurityConfig' with value '#xml/network_security_config')

I'm beginner developer in ionic.
I tried to "ionic cordova run android --device" command to run app on my phone.
fell into error below ('sample' is my project.)
:processDebugResources
/Users/xxx/sample/platforms/android/res/xml/config.xml:33:53-81: AAPT: No resource found that matches the given name (at 'networkSecurityConfig' with value '#xml/network_security_config').
/Users/xxx/sample/platforms/android/build/intermediates/res/merged/debug/xml/config.xml:33: error: Error: No resource found that matches the given name (at 'networkSecurityConfig' with value '#xml/network_security_config').
so, I did below action.
edit config.xml file to set real AndroidManifest.xml location.
(app/src/main/AndroidManifest.xml -> AndroidManfest.xml)
(before)
enter image description here
(after)
enter image description here
in my AndoridManifest.xml set minSdkVersion="16" and targetSdkVersion="26".
Any help would be appreciated. :)
PS) ionic info is...
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.2.4
Cordova Platforms : android 6.3.0 ios 4.5.5
Ionic Framework : ionic-angular 3.9.9
System:
Node : v6.11.3
npm : 3.10.10
OS : macOS
Xcode : Xcode 12.4 Build version 12D4e
it solved by edit config.xml file like this:
target="app/src/main/res/xml/network_security_config.xml" -> target="res/xml/network_security_config.xml"

Ngx-translate build prod issues in IONIC 4

I'm using ngx translate for translation in my ionic 4 project. But when i try to run:
ionic cordova build android -prod
Throws this error:
ERROR in Illegal State: referring to a type without a variable {"filePath":"C:/XXX/XXX/XXX/XXX/PROJECTNAME/node_modules/#ngx-translate/core/ngx-translate-core.d.ts","name":"TranslatePipe","members":[]}
[ERROR] An error occurred while running subprocess ng
My ionic info:
Ionic:
Ionic CLI : 5.2.7 (C:\Users\USER\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.9.0
#angular-devkit/build-angular : 0.801.3
#angular-devkit/schematics : 8.1.3
#angular/cli : 8.1.3
#ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (C:\Users\USER\AppData\Local\Android\Sdk)
NodeJS : v12.5.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
Please help!!!
The accepted answer is a solution to avoid the problem, but when a production build is needed, things are looking bad.
Workaround to achieve this is to access your tsconfig.json and disable fullTemplateTypeCheck to false. Include it, if you can not find it.
"angularCompilerOptions": {
"fullTemplateTypeCheck": false,
...
},
This error actually means that a reference failure is present among your components and modules. That could be a dupliate reference in a module or and submodule or any the like. This would result in ommiting to make a needed variable available. In your case that is the variable of ngx-translate (which your either call in the template or component file).
Setting the fullTemplateTypeCheck to false will help you to get the insights (including code line) about your false module references. But you must fix it yourself. Usually an easy fix. If you are uncertain, run again ng build --prod --verbose to see get more indications about the false relations.
you do not need to write -prod because it converts the file into minified version so device to hard to read. u just need run without -prod
ionic cordova build android
if you want a release APK just run
ionic cordova build android --release
after that, u do not face any issue.

I need to compile an old project (IONIC 2)

I have a project on ionic 2, which I have not touched for 3 years, but the client is asking me to change a simple link. And I can not build the application. What should I take into account to recover this project?
I do not want to migrate to ionic 3 or ionic 4, I just want to change the webservices link and that the application continues in ionic 2.
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
#ionic/app-scripts : 1.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 2.2.0
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
Node : v8.9.3
npm : 5.5.1
OS : macOS
Xcode : Xcode 10.1 Build version 10B61
Is it possible to build this old project on ionic 2 on my computer?
EDIT:
when sudo ionic cordova platform add android i get:
`(node:41668) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android#7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm WARN #ionic/app-scripts#1.1.4 requires a peer of #angular/tsc-wrapped#* but none is installed. You must install peer dependencies yourself.
npm WARN #ionic/cli-plugin-ionic-angular#1.3.1 requires a peer of #ionic/app-scripts#^1.3.7 but none is installed. You must install peer dependencies yourself.
npm ERR! Cannot read property '0' of undefined`
u should install Cordova first, like this,use # plus version number as needed
npm install -g cordova

I am getting Runtime Error when I update ionic2 project to ionic3 ?

Runtime Error
Module build failed: Error: ENOENT: no such file or directory, open '/Users/.../src/constants/Strings.js.map' at Error (native)
typescript": "2.3.4"
Ionic info
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.4.2
System:
Node : v6.10.3
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 5.0.3
reading this post on the official ionic blog it seems like it could be some import that are unmatched because capital letters.
Give it a try, hope this helps you to solve your problem.