Could Not Export APK, duplicate declaration of 'back'

I'm encountering an export issue while building my APK. Below is the error message I'm receiving. Could anyone help me with this?

For context, my project has 20 screens and uses an app script to connect to Google Sheets.

App Inventor is unable to compile this project.
The compiler error output was
[ReadBuildInfo] Starting Task
[ReadBuildInfo] Task succeeded in 0.004 seconds
[LoadComponentInfo] Starting Task
[LoadComponentInfo] INFO: Generating assets...
[LoadComponentInfo] Component assets needed, n = 0
[LoadComponentInfo] INFO: Generating activities...
[LoadComponentInfo] Component activities needed, n = 1
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify activityMetadata
[LoadComponentInfo] Component activity metadata needed, n = 0
[LoadComponentInfo] INFO: Generating broadcast receivers...
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify contentProviders
[LoadComponentInfo] INFO: Generating libraries...
[LoadComponentInfo] Libraries needed, n = 6
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify metadata
[LoadComponentInfo] Component metadata needed, n = 0
[LoadComponentInfo] INFO: Generating Android minimum SDK...
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify androidMinSdk
[LoadComponentInfo] INFO: Generating native libraries...
[LoadComponentInfo] Native Libraries needed, n = 0
[LoadComponentInfo] INFO: Generating permissions...
[LoadComponentInfo] usesLocation = False
[LoadComponentInfo] Permissions needed, n = 16
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify queries
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify services
[LoadComponentInfo] INFO: Component "edu.mills.appinventor.ChartMaker" does not specify xmls
[LoadComponentInfo] Component xmls needed, n = 0
[LoadComponentInfo] INFO: Generating component broadcast receivers...
[LoadComponentInfo] Task succeeded in 0.004 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 1.04 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.004 seconds
[CreateManifest] Starting Task
[CreateManifest] INFO: Reading project specs...
[CreateManifest] VCode: 1
[CreateManifest] VName: 1.0
[CreateManifest] Min SDK 7
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Screen1'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.about'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.reports_lis_F'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.S_PRAYER'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.reports_list'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.TS_List'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Alert_T'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.manage_accounts'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.request_account'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Homepage_A'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Dashboard_A'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Choose_Account'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.data_analytics'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.add_account'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Screen2'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Alert_S'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Homepage'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.T_ClassStatus'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.exit_map'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.Screen3'
[CreateManifest] INFO: Writing screen 'appinventor.ai_jedirenemendoza.MIT_SZ.request_list'
[CreateManifest] Task succeeded in 0.002 seconds
[AttachNativeLibs] Starting Task
[AttachNativeLibs] Task succeeded in 0.0 seconds
[AttachAarLibs] Starting Task
[AttachAarLibs] Task succeeded in 0.136 seconds
[AttachCompAssets] Starting Task
[AttachCompAssets] Task succeeded in 0.008 seconds
[MergeResources] Starting Task
[MergeResources] Task succeeded in 0.235 seconds
[SetupLibs] Starting Task
[SetupLibs] Task succeeded in 0.0 seconds
[RunAapt] Starting Task
[RunAapt] Task succeeded in 0.921 seconds
[GenerateClasses] Starting Task
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Screen1.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/about.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/reports_lis_F.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/S_PRAYER.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/reports_list.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/TS_List.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Alert_T.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/manage_accounts.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/request_account.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Homepage_A.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Dashboard_A.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Choose_Account.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/data_analytics.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/add_account.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Screen2.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Alert_S.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Homepage.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/T_ClassStatus.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/exit_map.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/Screen3.yail
[GenerateClasses] INFO: Source File: appinventor/ai_jedirenemendoza/MIT_SZ/request_list.yail
[GenerateClasses] INFO: Libraries Classpath = /tmp/kawa6219090089668825288.jar:/tmp/acra-4.4.05134477464482171011.jar:/tmp/AndroidRuntime14106808324495177771.jar:/tmp/annotation7190827710691536439.jar:/tmp/annotation-experimental8779748990263020070.jar:/tmp/appcompat5488323257068686035.jar:/tmp/asynclayoutinflater793410066310171625.jar:/tmp/collection703342902660804378.jar:/tmp/constraintlayout14825289331173222427.jar:/tmp/constraintlayout-solver5385445792710543166.jar:/tmp/coordinatorlayout1023412997367860129.jar:/tmp/core9283074293640905352.jar:/tmp/core-common18269483710480598450.jar:/tmp/core-runtime11039517968426886393.jar:/tmp/cursoradapter14277186018352371048.jar:/tmp/customview14751926837291348508.jar:/tmp/documentfile12345227838523660679.jar:/tmp/drawerlayout6540974899431095452.jar:/tmp/fragment3620245481472442638.jar:/tmp/interpolator4080558067465669589.jar:/tmp/legacy-support-core-ui2387566167666519857.jar:/tmp/legacy-support-core-utils1634747132268331780.jar:/tmp/lifecycle-common6724636826423104076.jar:/tmp/lifecycle-livedata14073520230436550062.jar:/tmp/lifecycle-livedata-core5446333098765448122.jar:/tmp/lifecycle-runtime10304430652585733929.jar:/tmp/lifecycle-viewmodel4339582879173205539.jar:/tmp/loader1791431824536686958.jar:/tmp/localbroadcastmanager8225532880810552876.jar:/tmp/print10708119566838951466.jar:/tmp/slidingpanelayout18097533021632373823.jar:/tmp/swiperefreshlayout15769326619950241070.jar:/tmp/vectordrawable17732481482803475380.jar:/tmp/vectordrawable-animated11464510516287157207.jar:/tmp/versionedparcelable448386861423142377.jar:/tmp/viewpager10503886808516108571.jar:/tmp/1746451731579_5623561555777794048-0/youngandroidproject/../assets/external_comps/edu.mills.appinventor.ChartMaker/files/AndroidRuntime.jar:/tmp/recyclerview160508783767598455.jar:/tmp/cardview15040080323307762657.jar:/tmp/dynamicanimation11659855285378132605.jar:/tmp/json3119534326928505308.jar:/tmp/1746451731579_5623561555777794048-0/youngandroidproject/../build/classes:/tmp/android15057247414168911567.jar
[GenerateClasses] ERROR: Kawa compile has failed.
(compiling appinventor/ai_jedirenemendoza/MIT_SZ/Screen1.yail to appinventor.ai_jedirenemendoza.MIT_SZ.Screen1)
(compiling appinventor/ai_jedirenemendoza/MIT_SZ/about.yail to appinventor.ai_jedirenemendoza.MIT_SZ.about)
ERROR: appinventor/ai_jedirenemendoza/MIT_SZ/about.yail line 141: duplicate declaration of 'back'
[GenerateClasses] ERROR: Can't find class file for Screen 'about'
[GenerateClasses] Task errored in 2.785 seconds

When you saw this message

tooManyScreens

why did you not stop when you reached 10 Screens? Most AI apps tend to become unstable after 10. You have 20 :frowning_face:

You probably have other issues too.

but it works perfectly with AI Companion :cry: :cry:

Go into your 'about' screen and rename the 'back' button to btnBack.

You have hit a known issue in AI2.

If you still can't compile, export the aia file and try on the code server, code.appinventor.mit.edu

1 Like

OMG! YOU'RE A BLESSING! It worked and now it exports to APK!

The only problem now is that when it go to a certain page after logging in, it automatically go back to the login page

See the screen switching section