Ionic - Angular with Capacitor on Android : All app updates must use Billing Library version 4 or newer. in-app-purchase-2 - ionic-framework

Version used: "#awesome-cordova-plugins/in-app-purchase-2": "^5.46.0",
Actions on Webstorm (ionic project) :
ionic build
npx cap sync
npx cap open android
Actions on Android Studio:
Generate a signed bundle
Actions on google play console:
Create new release with the signed bundle
Warning on google play :
We've detected that this app is using an old version of Google Play Billing. By November 1, 2022, all app updates must use Billing Library version 4 or newer. Update to Billing Library 4 before this date.
What I tried without success:
Add these two lines in the build.graddle:app and in capacitor.build.graddle and in the capacitor-cordova-android-plugins/build.graddle:
dependencies {
....
implementation "com.android.billingclient:billing:5.0.0"
}
What I want:
How do I update the PlayBillingLibrary from ionic and have it be taken into account with Capacitor when i sync my app on android (npx cap sync) ?
Thanks in advance

You need to update cordova-plugin-purchase to version 11.0.0 or higher (see RELEASE_NOTES.md).

Related

Error 'Plugin-Version' of 'unspecified' for 'com.android.build.gradle.AppPlugin#1544e09d' is not a valid version number. Ionic 6

when trying to build the project for android (ionic cordova build android --prod --release), I get the following error:
Error 'Plugin-Version' of 'unspecified' for 'com.android.build.gradle.AppPlugin#fbc39d3' is not a valid version number
OneSignal Warning: Could not get AGP plugin version
** I use cordova, I am stuck on that error as no material or explanations are coming to solve it
Ionic CLI : 6.13.1
Cordova CLI : 10.0.0
Cordova Platforms : android 9.1.0
Both lines are from OneSignal-Gradle-Plugin and indicate it could not find the version of the AGP (Android Gradle Plugin) in your project.
Error 'Plugin-Version' of 'unspecified' for 'com.android.build.gradle.AppPlugin#fbc39d3' is not a valid version number
OneSignal Warning: Could not get AGP plugin version
This Error and Warning messages will not cause a build failure. The AGP version detection is only used enable AGP 2.x.x fall back logic, if the version isn't found it assumes you are using AGP 3+. AGP 3 was first added in Cordova Android 7.0.0 so as long as you are using this version or newer this won't cause any side effects either.
Until OneSignal-Gradle-Plugin improves this version detection you can safely ignore these two messages from it.

Where is the version specified in Ionic app?

I'm using AppVersion.getVersionNumber() to get the version number of my Ionic app. But where does this number come from?
The problem is that when I run the app on a smartphone through devapp, I get a different version number depending on what OS I have…
iOS (on an iPhone 6): 1.0.2
Android (on a Samsung S10): 1.0.4
Searching around for "version" in my source code, I find this in config.xml (in the root):
<widget version="1.0.3" … >
I don't know if this is relevant, but it is the currently delivered version of the app.
I'm using Ionic 4.10.0
AppVersion cordova plugin reads the app details from the native code of the application.
So the version values that you see, are configured in the native IDE's.
Check these files in your respective platform folders..
ios/App/App.xcodeproj/project.pbxproj the key to look for in this MARKETING_VERSION
android/app/build.gradle the key to look for in this versionName

Ionic Native with console log from ionic cordova run ios -c

I have searched all over to get this answer but nothing works.
I am building an iPad app in Ionic 2 that uses various native plugins.
I want to be able to test the native features and observe the console logs but nothing gets logged, using either the ios emulator or an iPad device.
Ideally I also want livereload but I'll take what I can get.
I eventually got to display console logs in Xcode but that involves running
cordova platform prepare
then running the process from Xcode manually every time I make a single edit. This takes much longer than
ionic cordova run ios --target="iPad-Air" -c
Why can I not just see the logs when I use run?
I have looked at where it says the console.log file is saved to but no file gets created. I created the file myself and gave it full 777 permissions and still nothing.
ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.0.1
Cordova Platforms : browser 5.0.3 ios 4.5.2
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
Node : v8.8.0
npm : 5.4.2
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
To help anyone else who has trawled the forums and tried all the solutions where it seems everyone else can console.log except you, I will post what I have discovered. This is not a total solution but may identify the cause for some.
I was specifying the target as iPad-Air. When I didn't, the simulator started in iPhone-6. That is not what I wanted but there in my console was a very welcome console log message.
So I experimented a little and found that iPad-Air 10.0 and iPad-Air-2 10.0 and above will log to the console but 9.3 and lower (Not tested exhaustively) would not.
So for me, this solution will let me continue to develop with livereload and console logs and what's left of my hair.
Hopefully it will save someone else's hair loss too.
FYI you can set your chosen device as a project default in platforms/ios/cordova/lib/run.js in the deployToSim function. There should be a line like if (emulator.indexOf('iPhone') === 0) { swap out 'iPhone' (or whatever it is for you) and replace it with 'iPad-Air-2, 10.0' or whatever you need and have available in your simulator list. ios-sim showdevicetypes
Good luck!

How to keep both ionic 1, 3, version in my system

Initaially i was working with ionic 1.7.6 version with many apps. And by today some how i have changed to version 3.0.0. Now when i open my old projects under package.json i see the version as 3.0.0 instead of 1.7.6. And when i do sudo ionic build android it throws me some error to upgrade the version.
So now i have uninstall the ionic & cordova from my system.
Now i want to keep ionic 1 version 1.7.6 as well as ionic 3 version 3.0.0 how can i do it now.
so when ever i open the ionic 1 project i need to work on angularjs with ionic 1 version.
And when ever i open the project that i have created with version 3 i need to work with latest version of angular is with ionic 3..
please some one expalain me what should i need to do ??
Thank in advance !
I suspect you have installed ionic globally. If you want to run the local/project version of ionic you need to sudo ./node_modules/ionic/ionic ....
This will be the version of ionic as defined in the package.json of the project.
You can tuck this nicely away however using npm scripts (in your package.json):
e.g.
"scripts": {
"ionic": "sudo ./node_modules/ionic/ionic build "
}
Ten simply execute npm run ionic -- android

ionic phonegap-facebook-plugin iOS build - CompileC build error

The plugin had been working beautifully up until last night. Getting the following errors on iOS only after updating to latest Ionic/Cordova (android is fine).
Updated to:
xcode version 7.2.1
ionic version 1.7.14
I have also tested the same app with another mac running previous version of ionic 1.7.13 and cordova 6, and all is good.
After testing with the older version, i built a new mac (fresh wives laptop) with the latest ionic setup and again same error.
Here's the plugin in question https://ionicthemes.com/tutorials/about/native-facebook-login-with-ionic-framework
The following build commands failed:
CompileC build/testFresh.build/Debug-iphonesimulator/testFresh.build/Objects-normal/i386/FacebookConnectPlugin.o testFresh/Plugins/phonegap-facebook-plugin/FacebookConnectPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
ERROR running one or more of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Applications/AMPPS/www/ionic/testFresh/platforms/ios/cordova/build-debug.xcconfig,-project,testFresh.xcodeproj,ARCHS=i386,-target,testFresh,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Applications/AMPPS/www/ionic/testFresh/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Applications/AMPPS/www/ionic/testFresh/platforms/ios/build/sharedpch
You may not have the required environment or OS to run this project
After banging my head against a wall for a few days, I found that others were having the same issue though it was labeled as a "cordova 6" problem.
Original github issue:
https://github.com/Wizcorp/phonegap-facebook-plugin/issues/1227
Eventually whilst scrolling through known bugs under github for "phonegap-facebook-plugin" i noticed that similar errors had occurred on a previous release, then super Jeduan re-wrote the plugin and released it under the following:
Plugin fix:
https://github.com/jeduan/cordova-plugin-facebook4
The above appears to be working find under cordova 6, xcode version 7.2.1 and ionic version 1.7.14