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

Getting NoSuchMethodError exception #1056

Closed
nagesh-kashyap-r opened this Issue Apr 27, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@nagesh-kashyap-r
Copy link

nagesh-kashyap-r commented Apr 27, 2018

Hello,

I'm facing issue when loading offline maps
I followed instructions as in "https://github.com/osmdroid/osmdroid/wiki/Mapsforge"

This is the exception i got :

"java.lang.NoSuchMethodError: No static method setMaximumBufferSize(I)V in class Lorg/mapsforge/map/reader/ReadBuffer; or its super classes (declaration of 'org.mapsforge.map.reader.ReadBuffer'"

Gradle :
compile "org.osmdroid:osmdroid-mapsforge:5.6.5@aar"
compile 'org.mapsforge:mapsforge-map-android:0.9.1'
compile 'org.mapsforge:mapsforge-map:0.9.1'
compile 'org.mapsforge:mapsforge-themes:0.9.1'

@devemux86 devemux86 added the question label Apr 27, 2018

@devemux86

This comment has been minimized.

Copy link
Collaborator

devemux86 commented Apr 27, 2018

That's related on how Osmdroid uses Mapsforge, so should ask them for their implementation.

For questions please use the forum.

@devemux86 devemux86 closed this Apr 27, 2018

@TomasJohansson

This comment has been minimized.

Copy link

TomasJohansson commented Feb 16, 2019

That's related on how Osmdroid uses Mapsforge, so should ask them for their implementation.

But it is difficult for osmdroid (and other users of your library) to support your new versions if you introduce breaking changes such as removing a method from a published api.

In issue #994 git commit c755db6 you removed the method setMaximumBufferSize (which was setting the field MAXIMUM_BUFFER_SIZE) while instead introducing a new class Parameters with the field MAXIMUM_BUFFER_SIZE.

Was there a reason for deleting the method instead of trying to make it easier for other libraries to support new versions?
For example, doing something like this instead of deleting the method:

@Deprecated
public static synchronized void setMaximumBufferSize(int maximumBufferSize) {
	Parameters.setMaximumBufferSize(maximumBufferSize);
}

Unfortunately, now it seems diffcult for osmdroid to support a later version of mapsforge.
Quoting THE main contributor of omsdroid regarding support for mapsforge:
"wasn't a straight forward update due to the api changes and no clear path forward"
osmdroid/osmdroid#1265

Some more guidance from you in your changelog might be helpful for everyone trying to upgrade

@devemux86

This comment has been minimized.

Copy link
Collaborator

devemux86 commented Feb 16, 2019

We generally avoid to alter the public API unless there is need and that was one of those cases. Certainly there are no plans to support multiple code paths inside the library. Anyway the changelog is usually the right place to describe such changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.