You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/08/12 22:08:02 UTC

[GitHub] [cordova-android] debottam31 opened a new issue #1325: java.lang.NoSuchMethodError: No interface method getActivity()Landroid/app/Activity; in class Lorg/ap

debottam31 opened a new issue #1325:
URL: https://github.com/apache/cordova-android/issues/1325


   # Bug Report
   I am getting this error with a Cordova plugin only when I use cordova-android@10.0.0
   ## Problem
   W/System.err: java.lang.NoSuchMethodError: No interface method getActivity()Landroid/app/Activity; in class Lorg/apache/cordova/CordovaInterface; or its super classes (declaration of 'org.apache.cordova.CordovaInterface' appears in /data/app/com.plugin.dev.app-C58J8xz2jyHWPTMzJWfp-A==/base.apk!classes3.dex)
   W/System.err:     at com.dummy.modules.plugin.MyCordovaPlugin.execute(MyCordovaPlugin.java:58)
   W/System.err:     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
           at org.apache.cordova.PluginManager.exec(PluginManager.java:140)
   W/System.err:     at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
   W/System.err:     at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
   W/System.err:     at android.os.MessageQueue.nativePollOnce(Native Method)
   W/System.err:     at android.os.MessageQueue.next(MessageQueue.java:326)
           at android.os.Looper.loop(Looper.java:160)
   W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:65)
   
   It is referring to the **this.cordova.getActivity()** this line in the code.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1325: java.lang.NoSuchMethodError: No interface method getActivity()Landroid/app/Activity; in class Lorg/ap

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1325:
URL: https://github.com/apache/cordova-android/issues/1325#issuecomment-912711019


   [getActivity](https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/CordovaInterface.java#L58) interface has changed to return an `AppCompatActivity` instead of `Activity` type.
   
   This is an intentional change, `AppCompatActivity` is an `Activity` so I don't see how this could be a breaking change, perhaps you need to explicitly declare the type if you're storing the result in a variable:
   
   e.g.:
   
   ```
   AppCompatActivity activity = this.cordova.getActivity();
   ```
   
   Let us know if this helps. If not, we may need to know more about the plugin regarding it's usage of the activity to provide further assistance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org