Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Cannot set title on the main page in Android #37

Closed
frederikbosch opened this issue May 6, 2016 · 6 comments
Closed

Cannot set title on the main page in Android #37

frederikbosch opened this issue May 6, 2016 · 6 comments

Comments

@frederikbosch
Copy link
Contributor

frederikbosch commented May 6, 2016

05-06 20:18:14.995 12707 12707 I chromium: [INFO:CONSOLE(310)] "Error in Error callbackId: NativeHost1158829928 : Error: Native error: java.lang.RuntimeException: Error setting FrameLayout's UserControl.Content to Windows.UI.Xaml.Controls.Page{d535279 V.E...... ......I. 0,0-0,0}
05-06 20:18:14.995 12707 12707 I chromium:      at run.ace.IncomingMessages.set(IncomingMessages.java:206)
05-06 20:18:14.995 12707 12707 I chromium:      at run.ace.NativeHost$2.run(NativeHost.java:239)
05-06 20:18:14.995 12707 12707 I chromium:      at android.os.Handler.handleCallback(Handler.java:739)
05-06 20:18:14.995 12707 12707 I chromium:      at android.os.Handler.dispatchMessage(Handler.java:95)
05-06 20:18:14.995 12707 12707 I chromium:      at android.os.Looper.loop(Looper.java:148)
05-06 20:18:14.995 12707 12707 I chromium:      at android.app.ActivityThread.main(ActivityThread.java:5422)
05-06 20:18:14.995 12707 12707 I chromium:      at java.lang.reflect.Method.invoke(Native Method)
05-06 20:18:14.995 12707 12707 I chromium:      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
05-06 20:18:14.995 12707 12707 I chromium:      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
05-06 20:18:14.995 12707 12707 I chromium: Caused by: java.lang.RuntimeException: Cannot set title on the main page in Android unless you set <preference name="ShowTitle" value="true"/> in config.xml.
05-06 20:18:14.995 12707 12707 I chromium:      at run.ace.TabBar.setTitle(TabBar.java:39)
05-06 20:18:14.995 12707 12707 I chromium:      at Windows.UI.Xaml.Controls.Page.updateTitle(Page.java:67)
05-06 20:18:14.995 12707 12707 I chromium:      at Windows.UI.Xaml.Controls.Page.processBars(Page.java:75)
05-06 20:18:14.995 12707 12707 I chromium:      at Windows.UI.Xaml.Controls.ViewGroupHelper.setProperty(ViewGroupHelper.java:51)
05-06 20:18:14.995 12707 12707 I chromium:      at run.ace.IncomingMessages.set(IncomingMessages.java:191)
05-06 20:18:14.995 12707 12707 I chromium:      ... 8 more

Already found this thread on StackOverflow but that does not help me finding the solution. I tried uppercase/lowercase ShowTitle in the config.xml, both in android specific config and global config. It just won't work. Do you have any idea?

@frederikbosch
Copy link
Contributor Author

Now, even commenting the setTitle line does not seem to help. So I am not setting a title at all, but I am still receiving the error?!

@frederikbosch
Copy link
Contributor Author

frederikbosch commented May 6, 2016

It has to with the android build. Apps built by Phonegap do not suffer from this error, while my cordova run android are failing.

@frederikbosch
Copy link
Contributor Author

Actually I think this is a documentation issue. Since Phonegap does build this app, I should replicate its behaviour/settings locally. But that means, there are certain unmentioned criteria that have to be taken care of before you can use cordova run android.

@rliang
Copy link

rliang commented May 30, 2016

Looks like a problem with the cordova-android platform.

When running cordova prepare, the generated platforms/android/AndroidManifest.xml contains android:theme="@android:style/Theme.DeviceDefault.NoActionBar" regardless of the ShowTitle config.

AceExamples cleverly avoids this by overriding it in native/android/AndroidManifest.xml, and thus doesn't have this problem. Too bad this isn't documented...

@frederikbosch
Copy link
Contributor Author

@rliang Many thanks for clearing this. I created a PR that fixes this automatically!

adnathan pushed a commit that referenced this issue Jun 3, 2016
@frederikbosch
Copy link
Contributor Author

Thanks @adnathan !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants