# Building a new GUI app for android, builds but crashes

**URL:** <https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843>\
**Category:** Android\
**Created:** [June 11, 2019, 6:38pm UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843 "2019-06-11T18:38:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaukomedia](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@kaukomedia](https://forum.juce.com/u/kaukomedia)\
**Post date:** [June 11, 2019, 6:38pm UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/1 "2019-06-11T18:38:35Z")

</div>

Hello!

Using the latest Android Studio and latest master branch version of Juce. I got an GUI Application to build on AS but as soon as trying to run it, it will crash and says:

```
2019-06-11 21:34:29.114 8083-8083/com.yourcompany.kkkakkaaaaa E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.yourcompany.kkkakkaaaaa, PID: 8083
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yourcompany.kkkakkaaaaa/android.app.Activity}: java.lang.IllegalArgumentException: Expected receiver of type android.app.Application$ActivityLifecycleCallbacks, but got java.lang.Object
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7319)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)

```

Any ideas? :S

---

<div class="post-metadata">

**Author:** ![kaukomedia](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@kaukomedia](https://forum.juce.com/u/kaukomedia)\
**Post date:** [June 22, 2019, 11:30am UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/2 "2019-06-22T11:30:17Z")

</div>

This was solved by simply reinstalling Android Studio and latest Juce… Something probably went wrong during the installation of AS.

---

<div class="post-metadata">

**Author:** ![dub-2](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@dub-2](https://forum.juce.com/u/dub-2)\
**Post date:** [July 25, 2019, 3:43am UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/3 "2019-07-25T03:43:01Z")

</div>

Similar problem, DemoRunner crashes in more or less the same way, BUT other apps I’ve tried to build do run, so it appears to be a problem to do with wide strings, but (apparently) only DemoRunner

---

<div class="post-metadata">

**Author:** ![sonosaurus](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@sonosaurus](https://forum.juce.com/u/sonosaurus)\
**Post date:** [August 8, 2019, 9:02pm UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/4 "2019-08-08T21:02:47Z")

</div>

Hmm, I’m getting report of the same crash log in my app from a user running Android Q beta, but the same build works fine on all other devices/OS versions as far as I can tell. Kind of disturbing, that a reinstall of the SDK seemed to fix it for you @kaukomedia. I am targetting API 28 (min 21), whereas prior versions targeted 26, and may not have had this issue on Q.

---

<div class="post-metadata">

**Author:** ![sonosaurus](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@sonosaurus](https://forum.juce.com/u/sonosaurus)\
**Post date:** [August 13, 2019, 8:33pm UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/5 "2019-08-13T20:33:07Z")

</div>

Just for completeness, the patch shown in the pull request I just made fixes this issue when it is caused by running on Android Q devices:  
[https://github.com/WeAreROLI/JUCE/pull/574](https://github.com/WeAreROLI/JUCE/pull/574)

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [August 14, 2019, 1:16pm UTC](https://forum.juce.com/t/building-a-new-gui-app-for-android-builds-but-crashes/33843/6 "2019-08-14T13:16:53Z")

</div>

Added to `develop` in [be8a568](https://github.com/WeAreROLI/JUCE/commit/be8a568747854b3263b22a6996938009d09dbcff). Thanks for the PR!
