Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8281425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:01:39+00:00 2026-06-08T10:01:39+00:00

I am getting this error . Uncaught TypeError: Object # has no method ‘exec’

  • 0

I am getting this error .

Uncaught TypeError: Object # has no method ‘exec’ at file:///android_asset/www/JS/pg-plugin-screen-orientation.js:4

var screenOrientation = function() {}

screenOrientation.prototype.set  = function(str, success, fail) {

 PhoneGap.exec(success, fail, "ScreenOrientation", "set", [str]); // GETTING ERROR IN THIS LINE

};

navigator.screenOrientation = new screenOrientation();

I have followed the steps given in this document.
https://github.com/champierre/pg-plugin-screen-orientation


Now it is working fine . But the application crashes when this line got executed

activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); 

07-24 18:01:19.200: E/AndroidRuntime(12001): FATAL EXCEPTION: main
07-24 18:01:19.200: E/AndroidRuntime(12001): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@4054e820 is not valid; is your activity running?
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.view.ViewRoot.setView(ViewRoot.java:527)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.view.Window$LocalWindowManager.addView(Window.java:424)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.app.Dialog.show(Dialog.java:241)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at org.apache.cordova.Notification$1.run(Notification.java:205)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.app.Activity.runOnUiThread(Activity.java:3717)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at org.apache.cordova.Notification.alert(Notification.java:208)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at org.apache.cordova.Notification.execute(Notification.java:70)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at org.apache.cordova.api.PluginManager.exec(PluginManager.java:212)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:185)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.os.Looper.loop(Looper.java:123)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at android.app.ActivityThread.main(ActivityThread.java:3683)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at java.lang.reflect.Method.invokeNative(Native Method)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at java.lang.reflect.Method.invoke(Method.java:507)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-24 18:01:19.200: E/AndroidRuntime(12001):    at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:01:41+00:00Added an answer on June 8, 2026 at 10:01 am

    What version of PhoneGap/Cordova are you using? The PhoneGap object has been renamed as cordova in recent versions. So you might need to update the JS file to call cordova.exec instead of PhoneGap.exec.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error: uncaught TypeError: Object [object Object] has no method 'on' at
I am getting this error: Uncaught TypeError: Object [object Object] has no method 'calendricalDate'
For some reason, I'm getting this error message: Uncaught TypeError: Object #<an Object> has
I'm getting the error Uncaught TypeError: Object [object Object] has no method 'datepicker' in
I'm getting this JS error while trying to use Ember routing: Uncaught TypeError: Object
I'm getting the following error on using calendar component: Uncaught TypeError: Object # has
I keep getting this error: Error: uncaught exception: Syntax error, unrecognized expression: [object Object]
I'm getting the error Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type when I
I am getting the following error HERE The error reads: Uncaught TypeError: Object #
I'm getting this error Timestamp: 4/2/12 11:56:36 AM Error: uncaught exception: [Exception... Component returned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.