{ "id": "173071", "key": "TIMOB-26867", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2019-03-09T03:49:15.000+0000", "created": "2019-02-28T08:47:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-03-25T22:57:59.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The following crash was reported by several beta testers on certain devices (e.g. Honor, running Android 8.0.0):\r\n{code}\r\njava.lang.RuntimeException: Unable to start activity ComponentInfo\r\n\r\n{com.example.app/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation\r\nat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3297)\r\nat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3405)\r\nat android.app.ActivityThread.-wrap12(Unknown Source:0)\r\nat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)\r\nat android.os.Handler.dispatchMessage(Handler.java:108)\r\nat android.os.Looper.loop(Looper.java:166)\r\nat android.app.ActivityThread.main(ActivityThread.java:7523)\r\nat java.lang.reflect.Method.invoke(Native Method)\r\nat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)\r\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)\r\nCaused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation\r\nat android.app.Activity.onCreate(Activity.java:1081)\r\nat android.support.v4.app.SupportActivity.onCreate(SupportActivity.java:66)\r\nat android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:321)\r\nat android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:84)\r\nat org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:740)\r\nat org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)\r\nat android.app.Activity.performCreate(Activity.java:7383)\r\nat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)\r\nat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3250)\r\nat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3405) \r\nat android.app.ActivityThread.-wrap12(Unknown Source:0) \r\nat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994) \r\nat android.os.Handler.dispatchMessage(Handler.java:108) \r\nat android.os.Looper.loop(Looper.java:166) \r\nat android.app.ActivityThread.main(ActivityThread.java:7523) \r\nat java.lang.reflect.Method.invoke(Native Method) \r\nat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) \r\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) \r\n2019-02-28 09:34:23.503 30168-30168/? E/TiExceptionHandler: (main) [32,1389] Unable to start activity ComponentInfo{com.example.app/org.appcelerator.titanium.TiTranslucentActivity}\r\n: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation\r\n\r\nandroid.app.Activity.onCreate(Activity.java:1081)\r\nandroid.support.v4.app.SupportActivity.onCreate(SupportActivity.java:66)\r\nandroid.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:321)\r\nandroid.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:84)\r\norg.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:740)\r\norg.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)\r\nandroid.app.Activity.performCreate(Activity.java:7383)\r\nandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)\r\nandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:3250)\r\nandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3405)\r\nandroid.app.ActivityThread.-wrap12(Unknown Source:0)\r\nandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)\r\nandroid.os.Handler.dispatchMessage(Handler.java:108)\r\nandroid.os.Looper.loop(Looper.java:166)\r\nandroid.app.ActivityThread.main(ActivityThread.java:7523)\r\njava.lang.reflect.Method.invoke(Native Method)\r\ncom.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)\r\ncom.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)\r\n{code}\r\nWe force portrait in our AndroidManifest file to ensure the device cannot move to landscape:\r\n{code}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n{code}\r\nAny advice is appreciated. This is currently a blocker without workaround.", "attachment": [], "flagged": false, "summary": "Android: IllegalStateException: Only fullscreen opaque activities can request orientation", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Latest 8_0_X and master", "comment": { "comments": [ { "id": "446407", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You are running into this: [TIMOB-26157]\r\n\r\nThis is something Google doesn't support anymore. The work-around posted in the above ticket are the only solutions that I'm aware of... which means it can't be portrait-only anymore or you get rid of the translucency.\r\n\r\nThe fix we've implemented in the above ticket catches Google's exception when configuring it via JavaScript. In your case, you're setting it up via the \"AndroidManifest.xml\" which means it's being configured within Google's {{onCreate()}} method. Putting a try/catch around the {{super.onCreate()}} isn't going to work in this case because the activity will be in a bad state. I don't think there is any good work-around that we can do... other than have our build system remove the orientation setting from the translucent activity in the manifest.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-28T18:30:06.000+0000", "updated": "2019-02-28T18:30:06.000+0000" }, { "id": "446409", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We indeed use the {{modal: true}} flag (mainly for iOS). So if we remove that one for Android, it could fix it and we could re-enable the portrait flags added to {{}}? We removed it to temporarily fix it, but thats not ideal.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-28T18:46:58.000+0000", "updated": "2019-02-28T18:46:58.000+0000" }, { "id": "446411", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Removing the {{modal: true}} will only work-around it for opaque activities. It won't work for a \"translucent\" activity.\r\n\r\nSo, you would have to get rid of your translucent activity usage too. They can't have a fixed orientation. That's what Google took away _(why... I have no idea.)_.\r\n\r\nIf you want to layer translucent UI over an existing window that is portrait-only, then your only other option is to use a translucent {{View}} instead.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-28T18:56:22.000+0000", "updated": "2019-02-28T18:56:22.000+0000" }, { "id": "446412", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Side Note:*\r\nIn your \"AndroidManifest.xml\", each of your activity is set to the following...\r\n{code}\r\nandroid:confgChanges=\"keyboardHidden|orientation|screenSize\"\r\n{code}\r\n\r\nYou need more than those 3, otherwise the UI in your window will disappear. For example, if you display your app and connect a bluetooth keyboard, your UI will disappear.\r\n\r\nYou'll want to change all of the Titanium activities in your \"AndroidManifest.xml\" to the bellow...\r\n{code}\r\nandroid:confgChanges=\"keyboard|keyboardHidden|orientation|fontScale|screenSize|smallestScreenSize|screenLayout|density\"\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-28T19:02:59.000+0000", "updated": "2019-02-28T19:02:59.000+0000" }, { "id": "446413", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Josh! We don't use translucent windows as far as I can think of. Is there a way to verify that? A general guide on forcing portrait mode would be cool! [The one from Ben Bahrenburg|https://bencoding.com/2016/02/11/android-orientation-locking-for-titanium/] seems a bit outdated then.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-28T19:16:51.000+0000", "updated": "2019-02-28T19:16:51.000+0000" }, { "id": "446417", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Happy to help!\r\n\r\nI saw {{TiTranslucentActivity}} in your attached \"AndroidManifest.xml\" snippet. But that activity will only be used when your {{Ti.UI.Window}} has \"modal\" set to {{true}}, has an \"opacity\" value set, or a \"backgroundColor\" with an alpha value. You can see it in our native code here...\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/WindowProxy.java#L326\r\n\r\nYou can set up a window/activity to be portrait in code instead of via XML as shown below. If you do it in code, then the exception you are seeing will be caught by Titanium, but the negative consequence is that it won't be portrait-only.\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow({\r\n\torientationModes: [Ti.UI.PORTRAIT],\r\n});\r\nwindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-28T19:44:18.000+0000", "updated": "2019-02-28T19:44:34.000+0000" }, { "id": "446654", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unfortunately, this is not something we can fix in code.\r\n\r\nThe issue is on the XML side which is being handled by Google's {{onCreate()}} method. While we *can* put a try/catch are that method, the activity and the app will be left in a bad state. I don't think there is a good way to display an error dialog either since the UI will be in a bad state. But we do log the exception which adequately describes the issue. I think that's the best we can do for now.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-09T03:48:38.000+0000", "updated": "2019-03-09T03:48:38.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }