注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 D8: Cannot fit requested classes in a single dex file (# methods: 74485 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:132) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:119) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102) at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:432) at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:242) at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:57) at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:67) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:63) at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:63) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76) at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:60) at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:200) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) at java.lang.Thread.run(Thread.java:748) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null at Version.fakeStackEntry(Version_2.1.62.java:0) at com.android.tools.r8.utils.Y.a(SourceFile:78) at com.android.tools.r8.D8.run(D8.java:11) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:117) ... 36 more Caused by: com.android.tools.r8.utils.b: Cannot fit requested classes in a single dex file (# methods: 74485 > 65536) at com.android.tools.r8.utils.T0.error(SourceFile:1) at com.android.tools.r8.utils.T0.a(SourceFile:2) at com.android.tools.r8.dex.P.a(SourceFile:740) at com.android.tools.r8.dex.P$h.a(SourceFile:7) at com.android.tools.r8.dex.b.a(SourceFile:14) at com.android.tools.r8.dex.b.b(SourceFile:25) at com.android.tools.r8.D8.d(D8.java:133) at com.android.tools.r8.D8.b(D8.java:1) at com.android.tools.r8.utils.Y.a(SourceFile:36) ... 38 more
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:mergeDexDebug'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 37s [!] App requires Multidex support ┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────┐ │ Flutter multidex handling is disabled. If you wish to let the tool configure multidex, use the │ │ --mutidex flag. │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/guanguan/Library/Android/sdk • Platform android-31, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.10.1
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.65.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.36.0
[✓] Connected device (2 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator) • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.60
[!] HTTP Host Availability ✗ HTTP host https://maven.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out
java.lang.UnsatisfiedLinkError: Unable to load library 'CoreFoundation': dlopen(libCoreFoundation.dylib, 0x0009): tried: 'libCoreFoundation.dylib' (no such file), '/usr/lib/libCoreFoundation.dylib' (no such file), '//libCoreFoundation.dylib' (no such file) dlopen(libCoreFoundation.dylib, 0x0009): tried: 'libCoreFoundation.dylib' (no such file), '/usr/lib/libCoreFoundation.dylib' (no such file), '//libCoreFoundation.dylib' (no such file) Native library (darwin/libCoreFoundation.dylib) not found in resource path (/Applications/Android Studio.app/Contents/lib/bootstrap.jar:/Applications/Android Studio.app/Contents/lib/extensions.jar:/Applications/Android Studio.app/Contents/lib/util.jar:/Applications/Android Studio.app/Contents/lib/jdom.jar:/Applications/Android Studio.app/Contents/lib/log4j.jar:/Applications/Android Studio.app/Contents/lib/trove4j.jar:/Applications/Android Studio.app/Contents/lib/jna.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/tools.jar) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) at com.sun.jna.Library$Handler.<init>(Library.java:192) at com.sun.jna.Native.load(Native.java:596) at com.sun.jna.Native.load(Native.java:570) at com.intellij.util.text.DateFormatUtil.getMacFormats(DateFormatUtil.java:363) at com.intellij.util.text.DateFormatUtil.getDateTimeFormats(DateFormatUtil.java:303) at com.intellij.util.text.DateFormatUtil.<clinit>(DateFormatUtil.java:46) at com.intellij.openapi.wm.impl.status.StatusPanel$5.run(StatusPanel.java:196) at com.intellij.openapi.wm.impl.status.StatusPanel.updateText(StatusPanel.java:205) at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.setText(InfoAndProgressPanel.java:517) at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.lambda$setInfo$5(IdeStatusBarImpl.java:398) at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2319) at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.setInfo(IdeStatusBarImpl.java:396) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:541) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:143) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:465) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:426) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:415) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:397) at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:237) at com.sun.proxy.$Proxy140.setInfo(Unknown Source) at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:52) at com.intellij.notification.LogModel.setStatusMessage(LogModel.java:72) at com.intellij.notification.LogModel.addNotification(LogModel.java:44) at com.intellij.notification.EventLog$ProjectTracker.printNotification(EventLog.java:507) at com.intellij.notification.EventLog$ProjectTracker.access$400(EventLog.java:446) at com.intellij.notification.EventLog$MyNotificationListener.notify(EventLog.java:660) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:541) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:139) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:465) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:426) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:415) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:397) at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:237) at com.sun.proxy.$Proxy143.notify(Unknown Source) at com.intellij.notification.Notifications$Bus.doNotify(Notifications.java:84) at com.intellij.notification.Notifications$Bus.lambda$notify$1(Notifications.java:73) at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2319) at com.intellij.notification.Notifications$Bus.notify(Notifications.java:73) at com.intellij.notification.Notification.notify(Notification.java:349) at com.intellij.openapi.updateSettings.impl.UpdateChecker.showNotification(UpdateChecker.kt:563) at com.intellij.openapi.updateSettings.impl.UpdateChecker.showUpdateResult(UpdateChecker.kt:461) at com.intellij.openapi.updateSettings.impl.UpdateChecker.access$showUpdateResult(UpdateChecker.kt:68) at com.intellij.openapi.updateSettings.impl.UpdateChecker$doUpdateAndShowResult$2.run(UpdateChecker.kt:177) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46) at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847) at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Suppressed: java.lang.UnsatisfiedLinkError: dlopen(libCoreFoundation.dylib, 0x0009): tried: 'libCoreFoundation.dylib' (no such file), '/usr/lib/libCoreFoundation.dylib' (no such file), '//libCoreFoundation.dylib' (no such file) at com.sun.jna.Native.open(Native Method) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191) ... 80 more Suppressed: java.lang.UnsatisfiedLinkError: dlopen(libCoreFoundation.dylib, 0x0009): tried: 'libCoreFoundation.dylib' (no such file), '/usr/lib/libCoreFoundation.dylib' (no such file), '//libCoreFoundation.dylib' (no such file) at com.sun.jna.Native.open(Native Method) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204) ... 80 more Suppressed: java.io.IOException: Native library (darwin/libCoreFoundation.dylib) not found in resource path (/Applications/Android Studio.app/Contents/lib/bootstrap.jar:/Applications/Android Studio.app/Contents/lib/extensions.jar:/Applications/Android Studio.app/Contents/lib/util.jar:/Applications/Android Studio.app/Contents/lib/jdom.jar:/Applications/Android Studio.app/Contents/lib/log4j.jar:/Applications/Android Studio.app/Contents/lib/trove4j.jar:/Applications/Android Studio.app/Contents/lib/jna.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/tools.jar) at com.sun.jna.Native.extractFromResourcePath(Native.java:1095) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276) ... 80 more
New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache.
真是让人无语,竟然是 macOS Big Sur 11 beta 的问题,这个应该不是我这个问题的根本原因,毕竟我的 MBP 当前已经升级到了 12.3。