Can not build apk but ai companion is ok

hello, i can not compile to apk .. getting this if asked for apk HOWEVER it is ok on ai companion , stops at compiling part 2 at 50% . WAS ok till i added another 51 of IF/THEN blocks or steps , please help me if possible to reduce that 51 blocks as i have 3 of it .. total 153, so far i have two only of the 51 if/then as attached (total 102) but needs even to add 3rd one , my app has total about 6800 blocks>> App Inventor is unable to compile this project.
The compiler error output was
[ReadBuildInfo] Starting Task
[ReadBuildInfo] Task succeeded in 0.005 seconds
[LoadComponentInfo] Starting Task
[LoadComponentInfo] INFO: Generating assets...
[LoadComponentInfo] Component assets needed, n = 0
[LoadComponentInfo] INFO: Generating activities...
[LoadComponentInfo] Component activities needed, n = 2
[LoadComponentInfo] Component activity metadata needed, n = 0
[LoadComponentInfo] INFO: Generating broadcast receivers...
[LoadComponentInfo] INFO: Generating libraries...
[LoadComponentInfo] Libraries needed, n = 10
[LoadComponentInfo] Component metadata needed, n = 0
[LoadComponentInfo] INFO: Generating Android minimum SDK...
[LoadComponentInfo] INFO: Generating native libraries...
[LoadComponentInfo] Native Libraries needed, n = 0
[LoadComponentInfo] INFO: Generating permissions...
[LoadComponentInfo] usesLocation = false
[LoadComponentInfo] Permissions needed, n = 15
[LoadComponentInfo] Component xmls needed, n = 0
[LoadComponentInfo] INFO: Generating component broadcast receivers...
[LoadComponentInfo] Task succeeded in 0.003 seconds
[PrepareAppIcon] Starting Task
[PrepareAppIcon] INFO: Creating mipmap dirs...
[PrepareAppIcon] INFO: Generating icons...
[PrepareAppIcon] Generating icons for mipmap-mdpi
[PrepareAppIcon] Generating icons for mipmap-hdpi
[PrepareAppIcon] Generating icons for mipmap-xhdpi
[PrepareAppIcon] Generating icons for mipmap-xxhdpi
[PrepareAppIcon] Generating icons for mipmap-xxxhdpi
[PrepareAppIcon] Task succeeded in 0.389 seconds
[XmlConfig] Starting Task
[XmlConfig] INFO: Creating animation xml
[XmlConfig] Creating zoom_enter.xml
[XmlConfig] Creating fadeout.xml
[XmlConfig] Creating slide_v_exit.xml
[XmlConfig] Creating fadein.xml
[XmlConfig] Creating zoom_exit.xml
[XmlConfig] Creating slide_v_enter.xml
[XmlConfig] Creating zoom_exit_reverse.xml
[XmlConfig] Creating slide_v_enter_reverse.xml
[XmlConfig] Creating zoom_enter_reverse.xml
[XmlConfig] Creating slide_enter_reverse.xml
[XmlConfig] Creating slide_exit.xml
[XmlConfig] Creating hold.xml
[XmlConfig] Creating slide_enter.xml
[XmlConfig] Creating slide_v_exit_reverse.xml
[XmlConfig] Creating slide_exit_reverse.xml
[XmlConfig] INFO: Creating style xml
[XmlConfig] INFO: Creating provider_path xml
[XmlConfig] INFO: Creating network_security_config xml
[XmlConfig] INFO: Generating adaptive icon file
[XmlConfig] INFO: Generating round adaptive icon file
[XmlConfig] INFO: Generating adaptive icon background file
[XmlConfig] Task succeeded in 0.01 seconds
[CreateManifest] Starting Task
[CreateManifest] INFO: Reading project specs...
[CreateManifest] VCode: 7
[CreateManifest] VName: v2 Fri_3.5
[CreateManifest] Min SDK 14
[CreateManifest] INFO: Writing screen 'appinventor.ai_4vhvhvhvh.Ti_Ecclesia_Fri_56_9.Screen1'
[CreateManifest] Task succeeded in 0.003 seconds
[AttachNativeLibs] Starting Task
[AttachNativeLibs] Task succeeded in 0.0 seconds
[AttachAarLibs] Starting Task
[AttachAarLibs] Task succeeded in 0.13 seconds
[AttachCompAssets] Starting Task
[AttachCompAssets] Task succeeded in 0.015 seconds
[MergeResources] Starting Task
[MergeResources] Task succeeded in 0.206 seconds
[SetupLibs] Starting Task
[SetupLibs] Task succeeded in 0.0 seconds
[RunAapt] Starting Task
[RunAapt] Task succeeded in 0.892 seconds
[GenerateClasses] Starting Task
[GenerateClasses] INFO: Source File: appinventor/ai_4vhvhvhvh/Ti_Ecclesia_Fri_56_9/Screen1.yail
[GenerateClasses] INFO: Libraries Classpath = /tmp/kawa17836307757004200671.jar:/tmp/acra-4.4.012301341409436770627.jar:/tmp/AndroidRuntime16502308228892152231.jar:/tmp/annotation6916885117719934673.jar:/tmp/annotation-experimental11821757984318206716.jar:/tmp/appcompat15397748439101938301.jar:/tmp/asynclayoutinflater8656498784631944950.jar:/tmp/collection4824046993095585275.jar:/tmp/constraintlayout8572415303396679265.jar:/tmp/constraintlayout-solver708744488041796890.jar:/tmp/coordinatorlayout12401234025130550441.jar:/tmp/core15669243744968349091.jar:/tmp/core-common1147328770544869183.jar:/tmp/core-runtime13537944753917121010.jar:/tmp/cursoradapter2183288230067965868.jar:/tmp/customview15078142552438128692.jar:/tmp/documentfile17247536333565933706.jar:/tmp/drawerlayout15980214309423762111.jar:/tmp/fragment7101379876308128306.jar:/tmp/interpolator11360383607657633630.jar:/tmp/legacy-support-core-ui4863594794602200439.jar:/tmp/legacy-support-core-utils1093768567556568081.jar:/tmp/lifecycle-common10690353857363187109.jar:/tmp/lifecycle-livedata11206014791616389835.jar:/tmp/lifecycle-livedata-core5919486085070530911.jar:/tmp/lifecycle-runtime18385170610639772665.jar:/tmp/lifecycle-viewmodel11230240745809200119.jar:/tmp/loader8996839993418699127.jar:/tmp/localbroadcastmanager9802144491821601950.jar:/tmp/print16430754332653255376.jar:/tmp/slidingpanelayout4848122295048268716.jar:/tmp/swiperefreshlayout13196878953978340044.jar:/tmp/vectordrawable5957240787088531889.jar:/tmp/vectordrawable-animated16668427887793111324.jar:/tmp/versionedparcelable17524950450785355003.jar:/tmp/viewpager4797171248376176033.jar:/tmp/Barcode6681650429141400083.jar:/tmp/QRGenerator10585318527272115445.jar:/tmp/json18175540456034912126.jar:/tmp/google-http-client-android3-beta1686661497063279392.jar:/tmp/google-http-client9699942746678701944.jar:/tmp/google-api-client-android2-beta1752209328621960834.jar:/tmp/google-http-client-android2-beta13665885472117788746.jar:/tmp/guava3478216588801377577.jar:/tmp/google-api-client17271524411614113808.jar:/tmp/google-oauth-client15665357730281804779.jar:/tmp/1759327943849_8498025484169874432-0/youngandroidproject/../build/classes:/tmp/android16235925731813177620.jar
(compiling appinventor/ai_4vhvhvhvh/Ti_Ecclesia_Fri_56_9/Screen1.yail to appinventor.ai_4vhvhvhvh.Ti_Ecclesia_Fri_56_9.Screen1)
(compiling /tmp/runtime9372327373720776844.scm to com.google.youngandroid.runtime)
[GenerateClasses] Task succeeded in 6.826 seconds
[RunD8] Starting Task
[RunD8] INFO: Using pre-dexed dex-cached-e5b30834a730a27dd07bbc5d83f26174.dex <- /tmp/AndroidRuntime16502308228892152231.jar
[RunD8] INFO: Using pre-dexed dex-cached-4afd1465d334dee94ac700edb0374a45.dex <- /tmp/kawa17836307757004200671.jar
[RunD8] INFO: Using pre-dexed dex-cached-558104d32e109ad96655ecbe9fe4e39f.dex <- /tmp/annotation6916885117719934673.jar
[RunD8] INFO: Using pre-dexed dex-cached-ef239d31d31d166f7410d71e14db1a68.dex <- /tmp/swiperefreshlayout13196878953978340044.jar
[RunD8] INFO: Using pre-dexed dex-cached-de87276390f7a8c71064f3e7908c143b.dex <- /tmp/core-common1147328770544869183.jar
[RunD8] INFO: Using pre-dexed dex-cached-c950a9845cca4523f19bc2fc922b41bf.dex <- /tmp/legacy-support-core-utils1093768567556568081.jar
[RunD8] INFO: Using pre-dexed dex-cached-35076b6f638faca00c217e98a0385344.dex <- /tmp/interpolator11360383607657633630.jar
[RunD8] INFO: Using pre-dexed dex-cached-bee920fd1e059913bf2d820dbb234720.dex <- /tmp/lifecycle-common10690353857363187109.jar
[RunD8] INFO: Using pre-dexed dex-cached-1e4d689047e2ee2cc76b7203626e9c33.dex <- /tmp/customview15078142552438128692.jar
[RunD8] INFO: Using pre-dexed dex-cached-74360288e1016af9d6afdd39a2caa1b8.dex <- /tmp/asynclayoutinflater8656498784631944950.jar
[RunD8] INFO: Using pre-dexed dex-cached-d53c4c8eedbf41663110b03a33fe9914.dex <- /tmp/lifecycle-runtime18385170610639772665.jar
[RunD8] INFO: Using pre-dexed dex-cached-032c68a2c5e93c1baac1524e105bbe88.dex <- /tmp/collection4824046993095585275.jar
[RunD8] INFO: Using pre-dexed dex-cached-91b7d1f3cb5fd0fd2f3a4c939316139b.dex <- /tmp/versionedparcelable17524950450785355003.jar
[RunD8] INFO: Using pre-dexed dex-cached-16ea1fc3b7e49139559eafccec2708ab.dex <- /tmp/lifecycle-viewmodel11230240745809200119.jar
[RunD8] INFO: Using pre-dexed dex-cached-84637f838557e65ad5856467fd22316c.dex <- /tmp/print16430754332653255376.jar
[RunD8] INFO: Using pre-dexed dex-cached-a9e803bf51318b35fcaf603f59f25f7c.dex <- /tmp/vectordrawable5957240787088531889.jar
[RunD8] INFO: Using pre-dexed dex-cached-b73957ec00af79319f56aedf27dff3fc.dex <- /tmp/core-runtime13537944753917121010.jar
[RunD8] INFO: Using pre-dexed dex-cached-4e788f5c66d33a47036ae77a849ffa1b.dex <- /tmp/core15669243744968349091.jar
[RunD8] INFO: Using pre-dexed dex-cached-e890ce7827a13b8714afbb241f7e89b2.dex <- /tmp/lifecycle-livedata-core5919486085070530911.jar
[RunD8] INFO: Using pre-dexed dex-cached-9e7da29c234333f4d245d8baa48e1746.dex <- /tmp/annotation-experimental11821757984318206716.jar
[RunD8] INFO: Using pre-dexed dex-cached-81757b9148a3984b5874ef1fd300acdb.dex <- /tmp/documentfile17247536333565933706.jar
[RunD8] INFO: Using pre-dexed dex-cached-b83403f2b639cc6e7a6f9c0681d69367.dex <- /tmp/viewpager4797171248376176033.jar
[RunD8] INFO: Using pre-dexed dex-cached-c2a16bb02f51a6fcd1ff46dd1a78d0bf.dex <- /tmp/slidingpanelayout4848122295048268716.jar
[RunD8] INFO: Using pre-dexed dex-cached-2eabb48fdf784357d984acbda18ea6a3.dex <- /tmp/appcompat15397748439101938301.jar
[RunD8] INFO: Using pre-dexed dex-cached-7a5a85c38b934be86a121ca9b5e7477b.dex <- /tmp/vectordrawable-animated16668427887793111324.jar
[RunD8] INFO: Using pre-dexed dex-cached-a3a712d1d179d231b40a977ed5593202.dex <- /tmp/lifecycle-livedata11206014791616389835.jar
[RunD8] INFO: Using pre-dexed dex-cached-9b1768a7734de4eaf5a635a007ad4b25.dex <- /tmp/coordinatorlayout12401234025130550441.jar
[RunD8] INFO: Using pre-dexed dex-cached-d3d338969c3cd4ad53a888753da3b580.dex <- /tmp/cursoradapter2183288230067965868.jar
[RunD8] INFO: Using pre-dexed dex-cached-a116e0a41475b6522ae295f7cc4ff4b3.dex <- /tmp/legacy-support-core-ui4863594794602200439.jar
[RunD8] INFO: Using pre-dexed dex-cached-a07a23b88daaae0b48cdd25378e03b03.dex <- /tmp/localbroadcastmanager9802144491821601950.jar
[RunD8] INFO: Using pre-dexed dex-cached-bb8901219e7be6c576cc65e75503d7fa.dex <- /tmp/fragment7101379876308128306.jar
[RunD8] INFO: Using pre-dexed dex-cached-fca718e99e97cb52f4c8c0ada2c74e72.dex <- /tmp/drawerlayout15980214309423762111.jar
[RunD8] INFO: Using pre-dexed dex-cached-ccb6f0c5e0adc11059c3d609a2fd15d6.dex <- /tmp/loader8996839993418699127.jar
[RunD8] INFO: Using pre-dexed dex-cached-c0e4dda29672c028ea3ce0e3785040de.dex <- /tmp/constraintlayout8572415303396679265.jar
[RunD8] INFO: Using pre-dexed dex-cached-85f46a2fd295a23f59a391cccd7a11c8.dex <- /tmp/constraintlayout-solver708744488041796890.jar
[RunD8] INFO: Using pre-dexed dex-cached-5e8957d43c18b768aa7d081353a3dd55.dex <- /tmp/json18175540456034912126.jar
[RunD8] INFO: Using pre-dexed dex-cached-e76bc33991e95cf52e0a7f4cb6fd115b.dex <- /tmp/Barcode6681650429141400083.jar
[RunD8] INFO: Using pre-dexed dex-cached-858c8c82a639ca20a8f6a5893cc15177.dex <- /tmp/google-api-client17271524411614113808.jar
[RunD8] INFO: Using pre-dexed dex-cached-1e7d8f511de4b91fc404f18ad21af157.dex <- /tmp/google-http-client-android3-beta1686661497063279392.jar
[RunD8] INFO: Using pre-dexed dex-cached-25f0fdc2247663ae3fb9cb01b0c45b30.dex <- /tmp/google-http-client-android2-beta13665885472117788746.jar
[RunD8] INFO: Using pre-dexed dex-cached-f63dbf801fe2ae483b0799eb9dd2f87a.dex <- /tmp/google-http-client9699942746678701944.jar
[RunD8] INFO: Using pre-dexed dex-cached-d8c1a13913e1002696e4c22c29f1d05b.dex <- /tmp/google-oauth-client15665357730281804779.jar
[RunD8] INFO: Using pre-dexed dex-cached-34183dd13eefd80bd93dbefb2cca2c89.dex <- /tmp/QRGenerator10585318527272115445.jar
[RunD8] INFO: Using pre-dexed dex-cached-eae9048a7177a69881323c08c5122aa4.dex <- /tmp/guava3478216588801377577.jar
[RunD8] INFO: Using pre-dexed dex-cached-5c3dfb562d5c95e5c104910b7bd5491f.dex <- /tmp/google-api-client-android2-beta1752209328621960834.jar
[RunD8] ERROR: d8 failed.
[RunD8] Task errored in 11.031 seconds
.

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
    • You don't need a component for every data instance. Reuse those components.
    • If you can't fit data into a ListView or List Picker, show a small subset of the data in an Arrangement and slide it across the larger list of data.

thanks for your reply, would you please show me how to reuse component or reduce blocks of the attached png file i uploaded before in this thread? thank you