darryncampbell / darryncampbell-cordova-plugin-intent

General purpose intent shim layer for cordova appliations on Android. Handles various techniques for sending and receiving intents.
MIT License
86 stars 134 forks source link

Fatal Exception: java.lang.NoSuchMethodError #62

Closed bogdoslavik closed 5 years ago

bogdoslavik commented 5 years ago

Fatal Exception: java.lang.NoSuchMethodError No virtual method put(Ljava/lang/String;Ljava/util/Collection;)Lorg/json/JSONObject; in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /system/framework/core-libart.jar)

cordova 8.1.2 ionic 4.5.0

Please help me to resolve this issue.

darryncampbell commented 5 years ago

Hi, I have not seen that issue before. I do have a test application - https://github.com/darryncampbell/plugin-intent-api-exerciser, are you able to build that?

bogdoslavik commented 5 years ago

Hello! Your example app compiled and works well. I've compared config.xml and found what your example use android platform 7.0.0, but my project latest - 7.1.4. I downgraded to 7.0.0 and plugin in my project works with no errors.

But I need to use latest android engine (it supports fresh firebase and have some urgent for me bugs fixed) Can you please update your plugin?

P.S. I found what in latest cordova android developers removed some old java code, possible it is reason for this bug.

P.P.S. I also opened issue at cordova android (maybe possible to fix this bug on their side) https://github.com/apache/cordova-android/issues/597

darryncampbell commented 5 years ago

Thanks for the extra information, I am just trying to reproduce this but am unable to do so.
I am using the https://github.com/darryncampbell/plugin-intent-api-exerciser app and updating the android engine by following the instructions at https://cordova.apache.org/docs/en/latest/guide/platforms/android/upgrade.html to update to 7.1.4. Everything seems to still work, could you please let me know what I might be doing wrong to reproduce? Tested on an Oreo 8.1 device.

bogdoslavik commented 5 years ago

I've changed android engine to 7.1.4 and recompiled my project again and for now it works fine. Sorry, looks like it was some build issue in my project. May be some files was not downloaded correctly... Thank you for your time and great plugin you develop!

darryncampbell commented 5 years ago

No worries, glad the issue is now resolved