rblalock / core

Titanium / Alloy Boilerplate
Other
75 stars 31 forks source link

App Crash with Android 3.3.0.GA #10

Open arunshejul opened 10 years ago

mcongrove commented 10 years ago

Please provide more information, such as the error logs, device, what you were doing when the crash happened, screenshots... anything, really.

arunshejul commented 10 years ago

Hi Dev,

App crash happened at the time of app launching . screenshot_2014-08-26-14-06-38

Ti Studio - 3.3.0 Ti SDK - 3.3.0.GA Device - Nexus5

Console log -

[WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x415d1ba8) [ERROR] : TiApplication: (main) [348,348] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rblalock.core/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.; Titanium 3.3.0,2014/07/11 12:36,787cd39 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rblalock.core/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) [ERROR] : TiApplication: at android.app.ActivityThread.access$800(ActivityThread.java:135) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:136) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5001) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:515) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ERROR] : TiApplication: at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:108) [ERROR] : TiApplication: at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57) [ERROR] : TiApplication: at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:511) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:5231) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) [ERROR] : TiApplication: ... 11 more

Thanks

mcongrove commented 10 years ago

Did you make any changes, or run the application code exactly as-is without modification?

arunshejul commented 10 years ago

I have not done any modification, code is as it is, im just testing it on 3.3.0GA, because im using that sdk version.

Did you tested it on Ti SDK 3.3.0GA?

Thanks

arunshejul commented 10 years ago

Hi,

Got Solution :) Looks like the method Im using for hiding the action bar is only for 3.3.0.GA, http://www.appcelerator.com/blog/2014/08/hiding-the-android-actionbar/

Thanks

arunshejul commented 10 years ago

Hi got new issue in android back is not working, App.navigation.close() - is not working proper, please have a look into this issue

Its happening with Ti SDK 3.3.0.GA and 3.2.3.GA Working fine with Ti SDK 3.2.2.GA

Thanks.

arunshejul commented 10 years ago

Hi @mcongrove @rblalock ,

I found solution on above issue that is back is not working in android , its because of "animateIn" method in that "animation.left = 0;" is inside OS_IOS that is why in android getting "undefined"

I just updated code with outside of block OS_IOS "animation.left = 0;".

Before -

this.animateIn = function(_controller, _direction, _callback) {
    if(OS_IOS || OS_ANDROID) {
        var animation = Ti.UI.createAnimation({
            opacity: 1,
            duration: 300
        });

        animation.addEventListener("complete", function onComplete() {
            that.isBusy = false;

            if(_callback) {
                _callback();
            }

            animation.removeEventListener("complete", onComplete);
        });

        // WEIRD hack to ensure the animation below works on iOS.
        Ti.API.trace(that.parent.size.width);

        if(OS_IOS) {
            _controller.getView().left = (_direction === "left") ? -that.parent.size.width : that.parent.size.width;
            animation.left = 0;
        }
        _controller.getView().animate(animation);
    } else {
        that.isBusy = false;

        if(_callback) {
            _callback();
        }
    }
};

After -

this.animateIn = function(_controller, _direction, _callback) {
    if(OS_IOS || OS_ANDROID) {
        var animation = Ti.UI.createAnimation({
            opacity: 1,
            duration: 300
        });

        animation.addEventListener("complete", function onComplete() {
            that.isBusy = false;

            if(_callback) {
                _callback();
            }

            animation.removeEventListener("complete", onComplete);
        });

        // WEIRD hack to ensure the animation below works on iOS.
        Ti.API.trace(that.parent.size.width);

        if(OS_IOS) {
            _controller.getView().left = (_direction === "left") ? -that.parent.size.width : that.parent.size.width;
        }
        animation.left = 0;
        _controller.getView().animate(animation);
    } else {
        that.isBusy = false;

        if(_callback) {
            _callback();
        }
    }
};