Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of JSONObject.getNames for Android #128

Closed
stolstov opened this issue Sep 28, 2016 · 4 comments
Closed

Remove use of JSONObject.getNames for Android #128

stolstov opened this issue Sep 28, 2016 · 4 comments
Assignees

Comments

@stolstov
Copy link
Member

From #124

Problem
Google included their own slightly incompatible version of org.json:json in Android, and the Android Gradle plugin automatically excludes dependencies on any other version. Google's implementation of JSONObject is missing the static method getNames(JSONObject). ProGuard minimization detects the missing method and the build fails:

Warning: com.esri.core.geometry.JSONObjectEnumerator: can't find referenced method 'java.lang.String[] getNames(org.json.JSONObject)' in library class org.json.JSONObject

@stolstov
Copy link
Member Author

@kjkrum Could you test master branch if it works?

@kjkrum
Copy link
Contributor

kjkrum commented Oct 2, 2016

ProGuard no longer has a problem with it. But I can't find a sample of GeoJSON that doesn't trigger this exception at OperatorImportFromGeoJsonLocal line 194:

// According to the spec, a GeoJSON object must have both a type and
// a coordinates array
if (!b_type_found || (!b_coordinates_found && !skip_coordinates)) {
    throw new IllegalArgumentException("invalid argument");
}

Maybe I'm using it wrong.

OperatorImportFromGeoJson.local().execute(0, Geometry.Type.Unknown, GEOJSON, null);

@stolstov
Copy link
Member Author

stolstov commented Oct 3, 2016

@kjkrum The call looks correct. There are unit tests for geojson import export in the TestImportExport.java. Could you share a string that fails for you?

@kjkrum
Copy link
Contributor

kjkrum commented Oct 14, 2016

It works with a string from one of the unit tests. I just wasn't clear on what was supposed to be in the string.

@alocke alocke self-assigned this Mar 16, 2018
@alocke alocke closed this as completed Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants