cordova 3.4 file 1.0.1 resolveLocalFileSystemURI android issue - file-transfer

I am trying to get a full path to an image retrieved from Android image library. via the camera plugin.
window.resolveLocalFileSystemURI("content://media/external/images/media/83", function(fileEntry) {
or
window.resolveLocalFileSystemURL(imageURI, function(fileEntry) {
fileEntry.file(function(fileObj) {
newimageURI = fileObj.fullPath;
alert(newimageURI);
});
});
returns undefined.
There was updates the other day and it is no longer working. I have tried toURL() as well with no success.

Try removing the file plugin and adding it again. Works for me. I think it's related to this bug: Cordova iOS Plugins fail after building, unless I remove platform and plugin JSON first

Related

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient,

I can't run app on emulator/ real device.when i try to run app from vscode. it shows this error message. screenshot of debug console
i uninstall app and flutter clean.
UPDATE:
This error just happened to me when I launched the app in the store. I'm correcting it now, change the Location library to Gelocator.
At first I thought it was an error in Flutter 3.7.0, I lowered the version to 3.3.10 and 3.3.9 and the same problem continued. My solution was to change the location library to geolocator. It has almost the same functions, I only had to make a few changes.
https://pub.dev/packages/geolocator
No need to change the package I was also facing this issue I just fixed it:
Go into C:\Users\Qc\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.gradle :
changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
dependencies {
api '"com.google.android.gms:play-services-location:21.0.1'
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
List item In project at android level go into build.gradle and add this line:
in my case, got to C:\Users\Md Emarat Hossain\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.gradle and changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
I changed from "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" in my project this PATH
"C:\Users\chint\flutter.pub-cache\hosted\pub.dartlang.org\geolocator_android-4.1.7\android\build.gradle"

Flutter issue with Google Ads & Firebase Versions

I am using latest version of flutter 3.7.2
My app has google ads and firebase dependency for which is use following pubs latest versions
admob_flutter:
firebase_messaging:
firebase_core:
Everthing is working perfect but when I have uploaded app on playstore it gives me following error
For solution of above warning i done the change in app level gradle file and following line
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-ads:21.5.0' // this line added for solution
implementation platform('com.google.firebase:firebase-bom:29.3.0')
implementation 'com.google.firebase:firebase-analytics'
}
but after adding above line my firebase stopped working it crash when run app with following error.
NOTE: I have tried flutter clean, reinstall app, flutter pub upgrade
everything is up-to date. Also when i change line implementation
'com.google.android.gms:play-services-ads:21.5.0' to implementation
'com.google.android.gms:play-services-ads:19.2.0' everything is
working perfect
you help me with the part that you say works with only 'com.google.android.gms:play-services-ads:19.2.0' and I had the same problem but trying to solve it by changing this line:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.google.firebase:firebase-ads:21.5.0'
}
you try to change firebase-ads:19.1.0 to 21.5.0 and it will let you use
implementation 'com.google.android.gms:play-services-ads:21.5.0'
It works for me, hope helps you.
If you are using 'admob_flutter' and update to 'com.google.android.gms:play-services-ads:2.50.0' you couldn't use Admob, this is because 'admob_flutter' does not support 'play-services-ads:2.50.0'.
In this case, I used 'google_mobile_ads 2.3.0' it's verified and published by 'google.dev
https://pub.dev/packages/google_mobile_ads

Ionic native push registration format changed?

I am not sure why but it seems that the interface for push registration changed?
My app follows the logic from
https://ionicframework.com/docs/v3/native/push/
with
pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
where registration used to be of below type
export interface PushDevice{
registrationId: string;
registrationType: string;
}
but now I am getting
{"registrationId":"{length=32,bytes=0x459ca46ab66f4fe790220809215176d6...21b3436d13e78c64}","registrationType":"APNS"}
registrationID used to be a string, but now is a dictionary. How shall I handle this ID now? I have to convert it to a push token somehow... What changed? I looked into the phone gap plugin code but I can not find it...
https://github.com/phonegap/phonegap-plugin-push/blob/master/src/ios/PushPlugin.m
I faced the same issue in my ionic 1 app. Had to upgrade version of push plugin to 2.3.0 from 2.2.3. Moreover i also upgraded cordova-support-google-services to 1.3.2 to make it work. Although it was related to android but still had to do it. This plugin (phonegap-plugin-multidex) should have a version greater than or equal to 1.0.0
The plugins through which push notifications work fine for me are as follows:
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.3.0 "PushPlugin"
cordova-support-google-services 1.3.2 "cordova-support-google-services"
Hoepfully this helps
Finally found a lead. Seems this changed with the release of iOS 13.
https://forums.developer.apple.com/thread/117545
The Cordova push plugin has to be updated to v2.3.0 (I have not tested this yet), but my current version is failing because v2.2.3 is accessing the registrationId through a wrong method.
https://github.com/phonegap/phonegap-plugin-push/issues/2832
https://github.com/proreact/phonegap-plugin-push/commit/486c8f206536995c80101487b0fed1502edd5754

Ionic AppRate fails, incomplete object?

I am trying to add AppRate to my app based on the
https://ionicframework.com/docs/v3/native/app-rate/
example
TypeError: AppRate.preferences.openUrl is not a function. (In
'AppRate.preferences.openUrl(iOSStoreUrl)', 'AppRate.preferences.openUrl' is undefined)
That method is indeed missing on the object when inspected in debugger.
On the plugin documentation they add the method manually.
https://github.com/pushandplay/cordova-plugin-apprate
This approach fails for me however, too. My ionic app has no window object.
I had the same issue, but in ionic 4.
I solved it, firstly, reinstall the plugin from git repository or cordova plugins registry (to make sure we have the function openUrl added) and adding the missing method to #ionic-native/app-rate/ngx/index.d.ts like :
export interface AppRatePreferences {
...
...
...
openUrl?:(url:string) => void;
}
And after where you have used the call of the plugin, you add openUrl: appRate.preferences.openUrl to preferences properties like :
appRate.preferences = {
displayAppName: '',
storeAppURL: {
ios: '<my_app_id>',
android: 'market://details?id=<package_name>',
windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>',
blackberry: 'appworld://content/[App Id]/'
},
openUrl: appRate.preferences.openUrl
};
Hope it helps you.
For ionic 3, Make sure the latest versions are installed with support for #ionic-native/app-rate#4
In my case I have solved it by installing version 4 of #ionic-native and version 1.4.0 of apprate.
Try this:
$ ionic cordova plugin rm cordova-plugin-apprate
$ ionic cordova plugin add cordova-plugin-apprate#1.4.0 --save --exact
$ npm install --save #ionic-native/app-rate#4

Media plugin not installed? Ionic 3

I have an Ionic 3 app that requires to use Media Plugin.
When I press the "record" button on my app, this code block is executed:
this.platform.ready().then(() => {
this.fileName = this.commentsProvider.getFileName(this.platform);
this.filePath = this.commentsProvider.getFilePath(this.platform, this.fileName);
this.audio = this.media.create(this.filePath);
this.audio.startRecord();
this.recording = true;
});
And it doesn't works. The console throws:
console.warn: Native: tried accessing the Media plugin but it's not installed.
NOTE: I'm runing the app in a connected Android device, via USB.
You can see I'm using platform.ready() and anyway I still have this problem.
Any idea?
Thank's in advance!
EDIT: I've already deleted node_modules and plugins folders, and ran npm install, and the problem persists.