[求救 ]我無法進行apk的執行 ([Help] I cannot execute the apk)

App Inventor 無法編譯本專案
編譯器的錯誤訊息為
[ReadBuildInfo] Starting Task
[ReadBuildInfo] Task succeeded in 0.007 seconds
[LoadComponentInfo] Starting Task
[LoadComponentInfo] INFO: Generating assets...
[LoadComponentInfo] Component assets needed, n = 0
[LoadComponentInfo] INFO: Generating activities...
[LoadComponentInfo] Component activities needed, n = 0
[LoadComponentInfo] Component activity metadata needed, n = 0
[LoadComponentInfo] INFO: Generating broadcast receivers...
[LoadComponentInfo] Component content providers needed, n = 0
[LoadComponentInfo] INFO: Generating libraries...
[LoadComponentInfo] Libraries needed, n = 0
[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] INFO: Component "com.google.appinventor.components.runtime.Button" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.Clock" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.File" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.Form" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.HorizontalArrangement" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.Label" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.Sound" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.TextBox" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.TinyDB" does not specify permissionConstraints
[LoadComponentInfo] INFO: Component "com.google.appinventor.components.runtime.VerticalScrollArrangement" does not specify permissionConstraints
[LoadComponentInfo] usesLocation = False
[LoadComponentInfo] Permissions needed, n = 4
[LoadComponentInfo] Component services needed, n = 0
[LoadComponentInfo] INFO: Generating component broadcast receivers...
[LoadComponentInfo] Task succeeded in 0.008 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.22 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.008 seconds
[CreateManifest] Starting Task
[CreateManifest] INFO: Reading project specs...
[CreateManifest] VCode: 2
[CreateManifest] VName: 2.1
[CreateManifest] Min SDK 7
[CreateManifest] INFO: Writing screen 'appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM1'
[CreateManifest] INFO: Writing screen 'appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM2'
[CreateManifest] INFO: Writing screen 'appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM3'
[CreateManifest] INFO: Writing screen 'appinventor.ai_ehsanglee.A_mustinthe_LOTTO.Screen1'
[CreateManifest] Task succeeded in 0.001 seconds
[AttachNativeLibs] Starting Task
[AttachNativeLibs] Task succeeded in 0.001 seconds
[AttachAarLibs] Starting Task
[AttachAarLibs] Task succeeded in 0.188 seconds
[AttachCompAssets] Starting Task
[AttachCompAssets] Task succeeded in 0.001 seconds
[MergeResources] Starting Task
[MergeResources] Task succeeded in 0.242 seconds
[SetupLibs] Starting Task
[SetupLibs] Task succeeded in 0.0 seconds
[RunAapt] Starting Task
[RunAapt] Task succeeded in 1.001 seconds
[GenerateClasses] Starting Task
[GenerateClasses] INFO: Source File: appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM1.yail
[GenerateClasses] INFO: Source File: appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM2.yail
[GenerateClasses] INFO: Source File: appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM3.yail
[GenerateClasses] INFO: Source File: appinventor/ai_ehsanglee/A_mustinthe_LOTTO/Screen1.yail
[GenerateClasses] INFO: Libraries Classpath = /tmp/kawa6382686596131153730.jar:/tmp/acra-4.4.03213160698190870684.jar:/tmp/AndroidRuntime8542479320622439363.jar:/tmp/annotation3133122756331288262.jar:/tmp/appcompat1422485721402517618.jar:/tmp/asynclayoutinflater6993776803837029542.jar:/tmp/collection3789284838257744285.jar:/tmp/constraintlayout8030997924036897449.jar:/tmp/constraintlayout-solver7447260900812275952.jar:/tmp/coordinatorlayout5559277216038274957.jar:/tmp/core2736775530608684217.jar:/tmp/core-common4330212762168179324.jar:/tmp/core-runtime5466330851409213873.jar:/tmp/cursoradapter1366592617929661933.jar:/tmp/customview5701373264399169396.jar:/tmp/documentfile5023011281393632670.jar:/tmp/drawerlayout3803437513493407127.jar:/tmp/fragment5489271174809968324.jar:/tmp/interpolator2519264217734575968.jar:/tmp/legacy-support-core-ui2733922803947533469.jar:/tmp/legacy-support-core-utils4213267214024895367.jar:/tmp/lifecycle-common7658213801055208821.jar:/tmp/lifecycle-livedata6937803844104146561.jar:/tmp/lifecycle-livedata-core8467614696757284730.jar:/tmp/lifecycle-runtime7951789172521110526.jar:/tmp/lifecycle-viewmodel8008408206908309551.jar:/tmp/loader1949881979910273522.jar:/tmp/localbroadcastmanager6498056845472734577.jar:/tmp/print407095691376787241.jar:/tmp/slidingpanelayout4175199409489442873.jar:/tmp/swiperefreshlayout9018327513727020566.jar:/tmp/vectordrawable1688031943292552269.jar:/tmp/vectordrawable-animated4071833525505462907.jar:/tmp/versionedparcelable817837348782003485.jar:/tmp/viewpager4357731297521964363.jar:/tmp/1702905480343_0.8995052865939968-0/youngandroidproject/../build/classes:/tmp/android2384537996338762552.jar
(compiling appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM1.yail to appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM1)
(compiling appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM2.yail to appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM2)
(compiling appinventor/ai_ehsanglee/A_mustinthe_LOTTO/SAM3.yail to appinventor.ai_ehsanglee.A_mustinthe_LOTTO.SAM3)
(compiling appinventor/ai_ehsanglee/A_mustinthe_LOTTO/Screen1.yail to appinventor.ai_ehsanglee.A_mustinthe_LOTTO.Screen1)
(compiling /tmp/runtime3769081697559267950.scm to com.google.youngandroid.runtime)
[GenerateClasses] Task succeeded in 4.673 seconds
[RunMultidex] Starting Task
[RunMultidex] ERROR: DX returned an error code
[RunMultidex] Task errored in 36.928 seconds

我無法理解

Is it working in Ai companion?

DX errors usually mean you have too much of something.

請問,每個頁面有檔案框架數量的限制嗎?還是整個軟體有框架數量限制?

我是在pc上Chrome使用android 模擬器,連線測試的.

您是否在 android 模擬器中使用了 Mit Ai2 配套應用程式或使用 apk 安裝它 ?

Thanks,
Sai Neela

是的,我認為根據使用者@ABG帖子,我們可以做的事情是有限的,該帖子提到您的應用程式可能有太多東西,這就是它崩潰的原因。你介意分享代碼或告訴我們這是關於什麼的嗎?

Thanks,
Sai Neela

您可以嘗試簡化代碼來解決問題或尋找錯誤者

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

我只是使用模擬器運行,而執行封包apk是用Chrome

我開啟了4個頁面,其中一個有9000個指令,其他頁面100-2000個指令。但是檔案並不大,不超過4mb

See here

Taifun

(added to new DX Errors section of FAQ)

我試試看減少指令

那些「extensions」是指什麼?


global_declaration
我發現是全域變數造成的問題,當大多的指令都從同一個全域變數取得資料,會使檔案無法進行APK。

謝謝各位前輩的指導與分析,非常的感謝

太好了,我為你感到高興
還要標記您認為是問題解決方案的帖子。