Port SimpleImmutableEntry for Android2.2 or below#27
Conversation
|
Hi! Thank you for your pull request:-) I reviewed and merged your contribution into master branch. And I changed package name of PortedImmutableEntry that you added into 'org.msgpack.util.android'. Please see. Thanks, |
|
The change of the package name is great. Thank you for your prompt attention. |
|
I still have the same bug (with Android 4.2): |
|
Could you give me the following information?
|
|
.1. Yes, sure. As I modified the code after my previous message, here is the new traceback: .2. I put msgpack in the libs/ folder of my Android project and it has been compiled by ant. .3. yes By the way, here is my temporary and ugly fix: https://github.com/ProgVal/msgpack-java/commit/d0642a5da1744ef04b2f16dcb9935e41e0ee33de |
|
Thank you for the information! But... I can't reproduce the exception... Could you give me some additional information?
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Map<String, String> map = new HashMap<String, String>();
map.put("msgpack", "foobar");
try {
MessagePack messagePack = new MessagePack();
byte[] raw = messagePack.write(map);
MapValue mapValue = messagePack.read(raw).asMapValue();
if (MsgPackUtils.in(mapValue, "msgpack"))
Toast.makeText(this, "OK", Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
}
}
} |
|
One more thing, please tell me the API version (in project.properties) and "android:****SdkVersion" in your project. |
|
|
.3. I'm still getting an error: while my modified version works. Thanks for your support |
|
Thanks for your additional information :) I tried with the same conditions you told me except for device (I use Nexus7). But I can't reproduce the crash... Do you use proguard ? Well, I'll try Galaxy S 3 the day after tomorrow. |
|
I don't use proguard as far as I know. By the way, I forgot to tell I use ant and not Eclipse. Mitsunori Komatsu notifications@github.com a écrit :
Sent from my Android phone with K-9 Mail. Please excuse my brevity. |
|
I tried it on Galaxy S 3, but I couldn't reproduce the exception... |
|
hi @progval, Please check the problem again after fixing your environment. And can you make a patch? It would be really appreciated in this community:-) |
|
@komamitsu Did you try compiling with the same environment as me? (ant + openjdk) @muga I fixed my environment, sorry for not notifying you. |
|
er... guess what... Sorry for the inconvenience |
|
you mean that msgpack-java works well on your android 4.2? |
|
ok, np:-) anyway, thank you for your contribution, @komamitsu @progval !!! |
|
not totally, but at least there is one bug less. https://github.com/ProgVal/msgpack-java-android-fixes/commits/master
|
|
@progval I tried to build your project with ant, but some errors occured unfortunately. BTW, If you reproduce the exception, please tell me again :) |
msgpack-java was crashed on Android 2.2 or below when my application called SequentialMapValueImpl$EntrySetIterator.next(). It is because the method calls java.util.AbstractMap$SimpleImmutableEntry that doesn't exist in Android 2.2 or below.
Then I ported java.util.AbstractMap$SimpleImmutableEntry as org.msgpack.util.PortedImmutableEntry. I saw this commit worked on both Android 2.2 and 4.2.