flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.37k stars 27.55k forks source link

All my apps run perfectly on the iOS simulator and use to work for the android emulator, but now they don't. #48192

Closed abpalmarini closed 4 years ago

abpalmarini commented 4 years ago

This is what happens when I try run any app, including the flutter demo app, on the android emulator API 29. When I run it on the iOS simulator everything works perfectly and this does not happen. Do you know how I can fix this?

logs ```bash Launching lib/main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... I/flutter ( 7547): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 7547): The following NoSuchMethodError was thrown building Builder: I/flutter ( 7547): The method '[]' was called on null. I/flutter ( 7547): Receiver: null I/flutter ( 7547): Tried calling: []("weather") I/flutter ( 7547): I/flutter ( 7547): The relevant error-causing widget was: I/flutter ( 7547): MaterialApp file:///Users/abp/AndroidStudioProjects/weather_app/lib/main.dart:10:12 I/flutter ( 7547): I/flutter ( 7547): When the exception was thrown, this was the stack: I/flutter ( 7547): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5) I/flutter ( 7547): #1 _HomeScreenState.updateCurrentWeatherUI. (package:weather_app/screens/home_screen.dart:46:30) I/flutter ( 7547): #2 State.setState (package:flutter/src/widgets/framework.dart:1148:30) I/flutter ( 7547): #3 _HomeScreenState.updateCurrentWeatherUI (package:weather_app/screens/home_screen.dart:45:5) I/flutter ( 7547): #4 _HomeScreenState.initState (package:weather_app/screens/home_screen.dart:86:5) I/flutter ( 7547): #5 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58) I/flutter ( 7547): #6 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) I/flutter ( 7547): #7 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) **removed about 500 lines to shorten post** I/flutter ( 7659): #333 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:942:17) I/flutter ( 7659): #334 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2412:19) I/flutter ( 7659): #335 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:941:13) I/flutter ( 7659): #336 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:819:7) I/flutter ( 7659): #337 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:804:7) I/flutter ( 7659): #346 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19) I/flutter ( 7659): #347 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5) I/flutter ( 7659): #348 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12) I/flutter ( 7659): (elided 8 frames from package dart:async and package dart:async-patch) I/flutter ( 7659): I/flutter ( 7659): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter ( 8570): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter ( 8570): The following assertion was thrown during layout: I/flutter ( 8570): A RenderFlex overflowed by 21 pixels on the bottom. I/flutter ( 8570): I/flutter ( 8570): The relevant error-causing widget was: I/flutter ( 8570): Column I/flutter ( 8570): file:///Users/abp/AndroidStudioProjects/bmi-calculator-flutter/lib/screens/input_page.dart:144:28 I/flutter ( 8570): I/flutter ( 8570): The overflowing RenderFlex has an orientation of Axis.vertical. I/flutter ( 8570): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and I/flutter ( 8570): black striped pattern. This is usually caused by the contents being too big for the RenderFlex. I/flutter ( 8570): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the I/flutter ( 8570): RenderFlex to fit within the available space instead of being sized to their natural size. I/flutter ( 8570): This is considered an error condition because it indicates that there is content that cannot be I/flutter ( 8570): seen. If the content is legitimately bigger than the available space, consider clipping it with a I/flutter ( 8570): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, I/flutter ( 8570): like a ListView. I/flutter ( 8570): The specific RenderFlex in question is: RenderFlex#c015c relayoutBoundary=up5 OVERFLOWING: I/flutter ( 8570): needs compositing I/flutter ( 8570): creator: Column ← DecoratedBox ← Padding ← Container ← _PointerListener ← Listener ← I/flutter ( 8570): _GestureSemantics ← RawGestureDetector ← GestureDetector ← ReusableCard ← Expanded ← Row ← ⋯ I/flutter ( 8570): parentData: (can use size) I/flutter ( 8570): constraints: BoxConstraints(w=172.7, 0.0<=h<=129.5) I/flutter ( 8570): size: Size(172.7, 129.5) I/flutter ( 8570): direction: vertical I/flutter ( 8570): mainAxisAlignment: center I/flutter ( 8570): mainAxisSize: max I/flutter ( 8570): crossAxisAlignment: center I/flutter ( 8570): verticalDirection: down I/flutter ( 8570): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤ I/flutter ( 8570): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter ( 8570): Another exception was thrown: A RenderFlex overflowed by 21 pixels on the bottom. ✓ Built build/app/outputs/apk/debug/app-debug.apk. Installing build/app/outputs/apk/app.apk... Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install /Users/abp/AndroidStudioProjects/flutter_app_scratch/build/app/outputs/apk/app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] Error launching application on Android SDK built for x86. ```
iapicca commented 4 years ago

Hi @AlessandroPalmarini can you please provide your flutter doctor -v and your flutter run --verbose? Also, to better address the issue, would be helpful if you could post a minimal code sample or the steps to reproduce the problem. Thank you

abpalmarini commented 4 years ago

Hi @iapicca I ended up uninstalling the emulator and creating a new one with the API level 28 instead of 29 and the issue went away for me. Sorry that I couldn't help you to reproduce the problem.

iapicca commented 4 years ago

Hi @AlessandroPalmarini I'm glad that you found a workaround I'm closing the issue for the moment, let me know if the problem occurs again thank you

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.