Cordova-plugin-googlemaps: getOpenSourceSoftwareLicenseInfo not found in Google Play services

Created on 16 Aug 2017  路  32Comments  路  Source: mapsplugin/cordova-plugin-googlemaps

I'm submitting a ...
[ ] question
[x] any problem or bug report
[ ] feature request

plugin version: (check one with "x")
[ ] 1.4.x
[x] 2.0.0-beta2

Git rev: 785086e8139f8d8f6935912c5c87ad650c4d7f8d

cordova information: (run $> cordova plugin list)

cordova-fabric-plugin 1.1.9 "cordova-fabric-plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-camera-preview 0.9.0 "cordova-plugin-camera-preview"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-filechooser 1.0.1 "File Chooser"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin"
cordova-plugin-googlemaps 2.0.0-beta2-20170727-1500 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4-dev "Cordova WKWebView Engine"
ionic-plugin-keyboard 2.2.1 "Keyboard"
urbanairship-cordova 6.8.0 "Urban Airship"

Current behavior:
Ionic 3 Mobile App doesn't builds because getOpenSourceSoftwareLicenseInfo was not found in Google Play services.

Expected behavior:
App builds successfully.

Related code, data or error log (please format your code or data):

BUILD FAILED

        Total time: 1 mins 28.368 secs
        Error: /Users/pjorquera/work/mms/myGarage/platforms/android/gradlew: Command failed with exit code 1 Error 
        output:
        Note: Some input files use or override a deprecated API.
        Note: Recompile with -Xlint:deprecation for details.
        Note: Some input files use or override a deprecated API.
        Note: Recompile with -Xlint:deprecation for details.
        /Users/pjorquera/work/mms/myGarage/platforms/android/src/plugin/google/maps/AsyncLicenseInfo.java:22: error: 
        cannot find symbol
             String licenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(mActivity);
                                                        ^
           symbol:   method getOpenSourceSoftwareLicenseInfo(Activity)
           location: class GooglePlayServicesUtil
        /Users/pjorquera/work/mms/myGarage/platforms/android/src/plugin/google/maps/Environment.java:124: error: cannot 
        find symbol
             String msg = GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo(cordova.getActivity());
                                                             ^
           symbol:   method getOpenSourceSoftwareLicenseInfo(Activity)
           location: class GoogleApiAvailability
        Note: Some input files use or override a deprecated API.
        Note: Recompile with -Xlint:deprecation for details.
        Note: Some input files use unchecked or unsafe operations.
        Note: Recompile with -Xlint:unchecked for details.
        2 errors

        FAILURE: Build failed with an exception.

Google has deprecated (and removed) the symbol getOpenSourceSoftwareLicenseInfo(Context context) from Google Play services as can be seen here: https://developers.google.com/android/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getOpenSourceSoftwareLicenseInfo(android.content.Context)

fixed

Most helpful comment

Oops. Fixed.

All 32 comments

Thank you for letting me know. I will catch up later.

I have the same issue. @wf9a5m75 Do you know any temporary solution?

@gercinojr, you can fork the repo and remove / disable the deprecated methods in AsyncLicenseInfo.java and Environment.java until @wf9a5m75 releases a new version of the plugin (will apreciate if you also publish your changes as PR).

I'm contacting to Google Maps team in order to confirm that the license text is still required or not in iOS.

Okay, I updated the plugin code.

Since iOS still has the method, and it is not even deprecated, I keep the method.
But in Android, the method returns undefined.

Hi,

Can we download the fix?

Thank you.

You just need to reinstall the plugin.

Is that working if i reinstall from npm with the current branch, because I have the same problem for 1.4.3?

Here is the compile error (Im using npm with version 1.4.3), I just reinstalled the plugin)

Warning: /mnt/storage/builds/UtCIJfUEzu89Xb8riG/app/src/plugin/google/maps/GoogleMaps.java:717: error: cannot find symbol String msg = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(activity); ^ symbol: method getOpenSourceSoftwareLicenseInfo(Activity) location: class GooglePlayServicesUtil Warning: /mnt/storage/builds/UtCIJfUEzu89Xb8riG/app/src/plugin/google/maps/AsyncLicenseInfo.java:22: error: cannot find symbol Warning: String licenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(mActivity); ^ symbol: method getOpenSourceSoftwareLicenseInfo(Activity) location: class GooglePlayServicesUtil Warning: Note: Some input files use or override a deprecated API.

@wf9a5m75, there's some typo with your last commit: literal 0 in the file Environment.java:

https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/3c4eadda1c5b8f95279015aa63ed5d610984b3fa#diff-b0586d70c9c30dd91967b4d78a5a7cd9R40

Output log:

/home/travis/build/okode/mms/myGarage/platforms/android/src/plugin/google/maps/Environment.java:40: error: not a statement
                   }0
                    ^
        /home/travis/build/okode/mms/myGarage/platforms/android/src/plugin/google/maps/Environment.java:40: error: ';' expected
                   }0
                     ^
        2 errors
        :compileReleaseJavaWithJavac FAILED

        FAILURE: Build failed with an exception.

Oops. Fixed.

@wf9a5m75 can I use the 1.4.3 version from npm and compile ?

V1.4.3 is out of dated. Please use the v2.0-beta

I tried to but did not find a way to download it .

Is that on npm or ? Can you please provide a link ?

Thabk you , and thanks a lot for your reactivity.

Why do you want to download?

I use visual studio and build in cloud I need the zip file as I have it for npm . Is that something I miss?

I'm not Windows user, but it seems you can specify the github url.
(In this picture, select the git tag)

Thats exactly what I want the git url
Of the last beta version, where can I find it ?

Just specify https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps

Perfect , and this branch is stable enough for a large public production app?

Mostly stable, but still updates frequently.

Thank you again , great support mega thumbs up . Have a great day

v1.4 is also fixed. And I updated the npm.

@wf9a5m75 perfect! Now we could build succesfully with v2 version 馃憤

Updated my project to 1.4.4 version but in GoogleMaps.java class, the line 1285 references AsyncLicenseInfo, but it was deleted. If the class doesn't exist, what is the reason for this line?

Can't build my project with the 1.4.4 version. Any help?

Oh,...

@lpsantana I updated the code. Please try to reinstall the plugin.
(But I recommend you start moving to the v2.0)

Should we pull from master to get this fix or is it at 1.4.4 on npm?

I think this fix are in 1.4.5 version @cwoolum . See changelog for details

But this version was unable to install.

npm ERR! notarget No compatible version found: [email protected]
npm ERR! notarget Valid install targets:
npm ERR! notarget 1.3.4, 1.3.6, 1.3.7, 1.3.9, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4

Same here. Had to use master to unblock my build

published.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TimothyFehr picture TimothyFehr  路  5Comments

Tong2203 picture Tong2203  路  5Comments

battika picture battika  路  4Comments

nakulkundaliya picture nakulkundaliya  路  5Comments

wf9a5m75 picture wf9a5m75  路  3Comments