Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16379] Android: getLoading method does not exist on Android and causes a crash

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2018-05-16T19:45:41.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsreprod
ReporterJarosław Sobiecki
AssigneeUnknown
Created2014-02-04T09:31:06.000+0000
Updated2018-08-06T17:37:04.000+0000

Description

I have following error on Android build of application: [ERROR] : TiExceptionHandler: (main) [8,127839] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,127839] - In alloy/controllers/widgets/article_big.js:3,31 [ERROR] : TiExceptionHandler: (main) [0,127839] - Message: Uncaught TypeError: Object # has no method 'getLoading' [ERROR] : TiExceptionHandler: (main) [0,127839] - Source: if ($.body && !$.body.getLoading()) { [ERROR] : V8Exception: Exception occurred at alloy/controllers/widgets/article_big.js:3: Uncaught TypeError: Object # has no method 'getLoading' Same code works perfectly on IOS. I'm not sure if it's documentation issue(according to apidoc, getLoading() is supported on android) or if it's an Titanium SDK problem.
var window = Titanium.UI.createWindow({
    title: 'Test',
    fullscreen: true,
    exitOnClose: true,
    backgroundColor: 'white'
});
 
var view = Ti.UI.createView();
 
var webview = Titanium.UI.createWebView({
    backgroundColor: 'transparent',
    url: '/test.html'
});
 
view.add(webview);
window.add(view);
 
window.open();

alert ("getLoading: " + webview.getLoading());

Comments

  1. Ritu Agrawal 2014-02-05

    Moving this ticket to engineering as I can reproduce this issue with a simple Titanium test case. There are two issues: 1. getLoading method for a web view does not work for iOS platform. It returns undefined. Q&A thread indicates it to be a long standing issue: http://developer.appcelerator.com/question/135019/titaniumuiwebviewloading-and-getloading 2. getLoading method for a web view simply crashes on Android platform with the following error: [ERROR] : TiExceptionHandler: (main) [2015,2075] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [1,2076] - In app.js:20,33 [ERROR] : TiExceptionHandler: (main) [1,2077] - Message: Uncaught TypeError: Object # has no method 'getLoading' [ERROR] : TiExceptionHandler: (main) [0,2077] - Source: alert ("getLoading: " + webview.getLoading()); [ERROR] : V8Exception: Exception occurred at app.js:20: Uncaught TypeError: Object # has no method 'getLoading'
  2. jithinpv 2014-09-04

    Issue reproduces Titanium SDK version 3.4.0 master, 3.2.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
  3. jithinpv 2014-09-04

    Issue reproduces Titanium SDK version 3.4.0 master, 3.2.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
  4. Lee Morris 2017-06-27

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) This is the what the console outputs; [ERROR] : TiUIWebView: (main) [369,369] Problem reading from /test.html: Resources/test.html. Will let WebView try loading it directly. [ERROR] : TiUIWebView: java.io.FileNotFoundException: Resources/test.html [ERROR] : TiUIWebView: at android.content.res.AssetManager.openAsset(Native Method) [ERROR] : TiUIWebView: at android.content.res.AssetManager.open(AssetManager.java:347) [ERROR] : TiUIWebView: at android.content.res.AssetManager.open(AssetManager.java:321) [ERROR] : TiUIWebView: at org.appcelerator.titanium.io.TiResourceFile.getInputStream(TiResourceFile.java:77) [ERROR] : TiUIWebView: at ti.modules.titanium.ui.widget.webview.TiUIWebView.setUrl(TiUIWebView.java:537) [ERROR] : TiUIWebView: at ti.modules.titanium.ui.widget.webview.TiUIWebView.processProperties(TiUIWebView.java:428) [ERROR] : TiUIWebView: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1173) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:513) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:504) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:482) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:520) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:504) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:482) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:520) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:504) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:482) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:692) [ERROR] : TiUIWebView: at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:585) [ERROR] : TiUIWebView: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:261) [ERROR] : TiUIWebView: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33) [ERROR] : TiUIWebView: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:562) [ERROR] : TiUIWebView: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:676) [ERROR] : TiUIWebView: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21) [ERROR] : TiUIWebView: at android.app.Activity.performCreate(Activity.java:6679) [ERROR] : TiUIWebView: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) [ERROR] : TiUIWebView: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) [ERROR] : TiUIWebView: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) [ERROR] : TiUIWebView: at android.app.ActivityThread.-wrap12(ActivityThread.java) [ERROR] : TiUIWebView: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) [ERROR] : TiUIWebView: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiUIWebView: at android.os.Looper.loop(Looper.java:154) [ERROR] : TiUIWebView: at android.app.ActivityThread.main(ActivityThread.java:6119) [ERROR] : TiUIWebView: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiUIWebView: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) [ERROR] : TiUIWebView: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) [WARN] : cr_media: Requires BLUETOOTH permission [ERROR] : libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY) [WARN] : VideoCapabilities: Unrecognized profile 2130706433 for video/avc [WARN] : VideoCapabilities: Unrecognized profile 2130706434 for video/avc [INFO] : VideoCapabilities: Unsupported profile 4 for video/mp4v-es [INFO] : OpenGLRenderer: Initialized EGL, version 1.4 [ERROR] : AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources/test.html [WARN] : cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 6824 [INFO] : APSAnalyticsService: Analytics Service Started [INFO] : APSAnalyticsService: Stopping Analytics Service
  5. Hans Knöchel 2018-05-16

    The "loading" property (and its getter) is iOS-only, see [the docs](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-property-loading) for details.
  6. Eric Merriman 2018-08-06

    Closing as invalid. If incorrect, please reopen.

JSON Source