InAppBrowser build issue: Config.isUrlWhiteListed(url) undefined symbol @ src/org/apache/cordova/inappbrowser/InAppBrowser.java:124


#1

Hi,

I am having trouble making build with just InAppBrowser in a empty project. Here are the steps to reproduce this issue:

  1. I created a new Ionic 3.1.1 project and here is my ionic info
Cordova CLI: 7.0.0 
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: 5.0.6 
OS: macOS Sierra
Node Version: v4.2.6
Xcode version: Xcode 8.0 Build version 8A218a
  1. Then I added the plugin by running cordova plugin add cordova-plugin-inappbrowser --save and got following warning. Guess this is where things go wrong.
Unmet project requirements for latest version of cordova-plugin-inappbrowser:
    cordova (0.0.0 in project, >=3.1.0 required)
Fetching highest version of cordova-plugin-inappbrowser that this project supports: 0.2.2 (latest is 1.7.1)
Installing "org.apache.cordova.inappbrowser" for ios
Saved plugin info for "org.apache.cordova.inappbrowser" to config.xml
Adding org.apache.cordova.inappbrowser to package.json
  1. Reason for not doing ionic plugin add --save cordova-plugin-inappbrowser && npm install --save @ionic-native/in-app-browser as suggested in Ionic Native documentation @ http://ionicframework.com/docs/native/in-app-browser/ is I already tried it and had same problem. Now i am trying to isolate the problem and see if its a problem with the plugin, Cordova land or with Ionic.

  2. From above log, it seems some super old version of the plugin, 0.2.2 is getting installed rather than the latest, which is 1.7.1, since it couldn’t detect Cordova 7.0.0 installed. Any hint how to improve on this?

  3. Then when I build the project with ionic build android, am getting this build issue:

:generateDebugSources

:incrementalDebugJavaCompilationSafeguard

:compileDebugJavaWithJavac

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

/Users/saiy2k/projects/ionic/inapptest/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:124: error: cannot find symbol
                            || Config.isUrlWhiteListed(url)) {
                                     ^
  symbol:   method isUrlWhiteListed(String)

  location: class Config

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

:compileDebugJavaWithJavac FAILED

Any help?


InAppBrowser Android Build Getting Error
#2

Check first using ionic plugin list to get the list of actually installed plugins and versions.


#3

Remove the old version (version 0.2.2)

cordova plugin rm org.apache.cordova.inappbrowser

then install a later version

cordova plugin add cordova-plugin-inappbrowser@1.7.1 --save


#4

I wonder why this happens…


#5
cordova (0.0.0 in project, >=3.1.0 required)

this is according to me the real cause of the trouble. I’m having something similar myself, on a newly created cordova application. just cordova create, then adding plugins, and for cordova-plugin-inappbrowser I get the same error as here, only difference is in the line cordova (1.0.0 in project, >=3.1.0 required)
this is the script I run to create and initialize the cordova project.


#6

Then this is a case for the Cordova issue tracker: http://issues.cordova.io