Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release build fails for fresh Project created with flutter create. #33390

Closed
vazra opened this issue May 27, 2019 · 3 comments
Closed

Release build fails for fresh Project created with flutter create. #33390

vazra opened this issue May 27, 2019 · 3 comments

Comments

@vazra
Copy link

vazra commented May 27, 2019

Steps to Reproduce

  1. Create a new Flutter Project
  2. Run 'flutter build apk'
  3. Build Fails

Logs

Compiler message:                                                       
Error: SDK root directory not found: file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/.
Error: Error when reading 'file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Error: Error when reading 'file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Unhandled exception:                                                    
Crash when compiling package:flutter_app/main.dart,                     
at character offset null:                                               
RangeError (index): Index out of range: no indices are valid: 0         
#0      Uint8List.[] (dart:typed_data-patch/typed_data_patch.dart:2188:7)
#1      BinaryBuilder.readByte (package:kernel/binary/ast_from_binary.dart:95:27)
#2      BinaryBuilder.readUint32 (package:kernel/binary/ast_from_binary.dart:115:13)
#3      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:435:17)
#4      ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:388:10)
#5      ProcessedOptions.loadLinkDependencies.<anonymous closure> (package:front_end/src/base/processed_options.dart:376:35)
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#7      ListIterable.toList (dart:_internal/iterable.dart:219:19)       
#8      ProcessedOptions.loadLinkDependencies (package:front_end/src/base/processed_options.dart:376:67)
<asynchronous suspension>                                               
#9      generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:95:42)
<asynchronous suspension>                                               
#10     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
<asynchronous suspension>                                               
#11     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:55:10)
<asynchronous suspension>                                               
#12     kernelForProgram.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:48:28)
<asynchronous suspension>                                               
#13     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:134:20)
<asynchronous suspension>                                               
#14     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#15     new Future.sync (dart:async/future.dart:224:31)                 
#16     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#17     _rootRun (dart:async/zone.dart:1124:13)                         
#18     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#19     _runZoned (dart:async/zone.dart:1516:10)                        
#20     runZoned (dart:async/zone.dart:1463:12)                         
#21     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#22     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:132:10)
#23     kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:47:32)
<asynchronous suspension>                                               
#24     compileToKernel (package:vm/kernel_front_end.dart:301:27)       
<asynchronous suspension>                                               
#25     FrontendCompiler.compile.<anonymous closure> (package:vm/frontend_server.dart:350:56)
#26     new Future.<anonymous closure> (dart:async/future.dart:176:37)  
#27     _rootRun (dart:async/zone.dart:1120:38)                         
#28     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#29     _CustomZone.runGuarded (dart:async/zone.dart:923:7)             
#30     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#31     _rootRun (dart:async/zone.dart:1124:13)                         
#32     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#33     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#34     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#35     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)   
#36     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#37     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
                                                                        
                                                                        
#0      Uint8List.[] (dart:typed_data-patch/typed_data_patch.dart:2188:7)
#1      BinaryBuilder.readByte (package:kernel/binary/ast_from_binary.dart:95:27)
#2      BinaryBuilder.readUint32 (package:kernel/binary/ast_from_binary.dart:115:13)
#3      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:435:17)
#4      ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:388:10)
#5      ProcessedOptions.loadLinkDependencies.<anonymous closure> (package:front_end/src/base/processed_options.dart:376:35)
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#7      ListIterable.toList (dart:_internal/iterable.dart:219:19)       
#8      ProcessedOptions.loadLinkDependencies (package:front_end/src/base/processed_options.dart:376:67)
<asynchronous suspension>                                               
#9      generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:95:42)
<asynchronous suspension>                                               
#10     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
<asynchronous suspension>                                               
#11     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:55:10)
<asynchronous suspension>                                               
#12     kernelForProgram.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:48:28)
<asynchronous suspension>                                               
#13     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:134:20)
<asynchronous suspension>                                               
#14     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#15     new Future.sync (dart:async/future.dart:224:31)                 
#16     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#17     _rootRun (dart:async/zone.dart:1124:13)                         
#18     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#19     _runZoned (dart:async/zone.dart:1516:10)                        
#20     runZoned (dart:async/zone.dart:1463:12)                         
#21     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#22     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:132:10)
#23     kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:47:32)
<asynchronous suspension>                                               
#24     compileToKernel (package:vm/kernel_front_end.dart:301:27)       
<asynchronous suspension>                                               
#25     FrontendCompiler.compile.<anonymous closure> (package:vm/frontend_server.dart:350:56)
#26     new Future.<anonymous closure> (dart:async/future.dart:176:37)  
#27     _rootRun (dart:async/zone.dart:1120:38)                         
#28     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#29     _CustomZone.runGuarded (dart:async/zone.dart:923:7)             
#30     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#31     _rootRun (dart:async/zone.dart:1124:13)                         
#32     _CustomZone.run (dart:async/zone.dart:1021:19)                  
#33     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#34     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#35     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)   
#36     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#37     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
                                                                        
Compiler terminated unexpectedly.                                       
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       2.7s
Gradle task assembleRelease failed with exit code 1
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-US)
    • Flutter version 1.5.4-hotfix.2 at /Users/macuser/Programs/flutter
    • Framework revision 7a4c33425d (4 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/macuser/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/macuser/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.2

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.34.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.0.2

[✓] Connected device (1 available)
    • Redmi Note 7 • d75ec2da • android-arm64 • Android 9 (API 28)

flutter build apk --debug works fine

@kangwang1988
Copy link
Contributor

@arv1989
It seems the cache folder for your flutter installation is broken. You can do steps below:
a. rm -rf /Users/macuser/Programs/flutter/bin/cache
b./Users/macuser/Programs/flutter/bin/flutter doctor -v
And then re-run the flutter build apk command.

@kangwang1988 kangwang1988 added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 27, 2019
@vazra
Copy link
Author

vazra commented May 28, 2019

@kangwang1988 Thanks! It worked.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 28, 2019
@vazra vazra closed this as completed May 28, 2019
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants