cordova inAppBrowser not working on android - android

I have a situation where my inAppBrowser is not working on android but it's working in IOS, browser and PhoneGap App.
I don't exactly know what's wrong here, but I have the feeling that the following
errors are causing this problem
/System.err: java.lang.ClassNotFoundException: org.apache.cordova.inappbrowser.InAppBrowser
/com.test.wrapper I/System.out: Error adding plugin org.apache.cordova.inappbrowser.InAppBrowser.
Is there anyone who is facing a similar issue? Anybody able to help here?

If this issue is happening recently, the reason is a bug in Cordova Android 7.1.3.
Refer the following links,
Android Class Not Found
Plugin doesn't install correctly
Your best option is to stick with Cordova android 7.1.2 or upgrade to 7.1.4.
You can specify the Cordova Android version while installing like this,
cordova platform add android#7.1.4

The error message tells you the problem. The plugin did not get added to the project.
Uninstall & reinstall the plugin.
cordova plugin remove cordova-plugin-inappbrowser
cordova plugin add cordova-plugin-inappbrowser

Related

Capacitor Quasar "Geolocation" plugin is not implemented on android

I added capacitor via the quasar framework. I didn't add any plugin at first and everything worked perfectly. Then I updgraded to capacitor v3. I followed the guide and my app worked also without any problems. Then I added the geolocation plugin to capacitor. It works as expected in the browser, but when I try it on my native android device it gives me this error:
"Geolocation" plugin is not implemented on android
It looks like I didn't install the plugin, but as I said, it works in the browser.
Ok fixed it, by checking both package.json files (also the one in /src-capacitor). I used capacitor 3 in my web project but capacitor 2 in my capacitor project. I wanted to use v3 so I tried to access the plugin in the way of capacitor v3 which did not work.
This is because Capacitor changes the underlying Gradle files but Android Studio doesn't know.
To fix this, go to Android studio click File -> Sync Project with Gradle Files

Cannot find plugin.xml for plugin "cordova-plugin-ionic"

I have an ionic application and I want to add an android platform to it by using ionic cordova platform add android but it doesn't finish installing all of my plugins and stopped with cordova-plugin-google-analytics with this error.
I even looked for solutions on the net but I didn't find some. I also noticed that there is already an existing topic the same with my problem but there is no solution so far.
Cannot find plugin.xml for plugin "cordova-plugin-ionic". Please try adding it again

Cordova pruning error for android config.xml

When I run cordova build android I get the following error:
Error: Pruning at selector "widget" from "/Library/WebServer/Documents/app/app-name/platforms/android/res/xml/config.xml" went bad.
I have tried reinstalling the Android platform several times, but no luck.
I am using Cordova 6.1.1, Android 5.1.1 and have updated Android Studio to the latest Dev tools and SDK.
Anyone else experienced this problem? I can't find anything similar online.
If anyone else experiences this issue, I fixed it by:
Removing all platforms.
Removing all plugins
Update Cordova
Add all platforms
Add all plugins
Build Android should run successfully.

Cordova Android platform upgrade from CLI 3 to 4 breaks build

I'm running cordova 5. I used to have the android platform 3.7.1 and everything was fine.
Today I upgraded the android platform to 4.0.2 (cordova platform android update#4.0.2). Since then, my compiled projects get a 404 error when trying to load remote .js scripts. Went back to 3.7.1 and it works.
What's the proper way to upgrade a Cordova Android project? Is there a new setting for network access?? Something I missed in the upgrade?
Posting the answer..
So far, the only way for me to make my project work again was to create a new cordova project and re-import plugins and edit config.xml. I tried upgrading the current project in its current folder but it would never work even if the upgrading was a success (according to cordova). Bottom line: upgrading does not work.
If you're running cordova 5.0 the chances are you haven't installed the white-list plugin.
cordova plugin add cordova-plugin-whitelist
or if you want to save the reference to your config.xml file:
cordova plugin add cordova-plugin-whitelist --save
You can find more info here.
This is because cordova uses cordova-android#4.0.0 as the default version now.
http://cordova.apache.org/announcements/2015/04/15/cordova-android-4.0.0.html
You need to add the whitelist plugin as described by #LeftyX earlier.
cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
But then you also need to edit the config.xml to allow access to your sites - the whitelist plugin only allows access to file URLs by default.
The easiest way to restore functionality is to add:
<!-- A wildcard can be used to whitelist the entire network,
over HTTP and HTTPS.
*NOT RECOMMENDED* -->
<allow-navigation href="*" />
But as you can see, that is not recommended.
You should really lock it down to make it more secure.
Other options are documented in the README for the whitelist plugin.
https://github.com/apache/cordova-plugin-whitelist
Source: After I performed both the steps mentioned above, my 404s disappeared.

Adding Dialogs Plugin to phonegap project prevents deviceReady from Firing

I started using phonegap but as a beginner i ran into many problems.
one of the latest is problem with adding plugins
I added plugin of dialogs
org.apache.cordova.dialogs
with command line tool and it added successfully . but after running application in android emulator it never fire deviceReady Event. before adding plugin it was OK.
as a note I should say I installed older versions of plugin but they didn't work either !
Well I found the answer , I was building my project with phonegap but installed cordova plugins , I create a new project with command
cordova create project [folder name] [namespace "like com.example.appname"]
[project name]
and it worked correctly after that and I installed plugins as usual .

Categories

Resources