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

编译就直接不通过 #1

Closed
DreamClimb opened this issue Oct 29, 2018 · 4 comments
Closed

编译就直接不通过 #1

DreamClimb opened this issue Oct 29, 2018 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@DreamClimb
Copy link

Flutter的版本我本地的是0.10.2-pre.53,编译全部报错.不知道需要改动pubspec.yaml这个文件的那里,import 导包的时候全部是错的。

@hurshi
Copy link
Owner

hurshi commented Oct 29, 2018

Build

  • 工程环境配置好的话,是不需要更改pubspec.yaml文件的,能直接编译运行的

Debug

  1. 确保 Flutter 环境OK,执行flutter doctor

  2. 确保下载了所有依赖,执行:flutter packages get

  3. 如果以上还是不行的话,再看看这里

    1. 确保已经安装过XCode,并且打开过(会安装一些组件,并且让你同意一些条约)

    2. 如果是Android的话确保Android SDK,以及Android依赖下载,执行:

      $ cd android/
      $ ./gradlew clean
      
  4. 如果是下面这个报错,解决方案见stackoverflow

    * What went wrong:
    A problem occurred evaluating project ':app'.
    	> Could not resolve all artifacts for configuration 'classpath'.
    		> Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     		Searched in the following locations:
         		https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
    

我的环境

  1. 设备:MacOS

  2. Flutter

    $ flutter --version
    Flutter 0.9.4 • channel beta • https://github.com/flutter/flutter.git
    Framework • revision f37c235c32 (5 weeks ago) • 2018-09-25 17:45:40 -0400
    Engine • revision 74625aed32
    Tools • Dart 2.1.0-dev.5.0.flutter-a2eb050044
    
    $ flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 *****, locale zh-Hans-CN)
    [✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    [✓] Android Studio
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [✓] Android Studio (version 3.2)
    [!] VS Code (version 1.28.2)
    [!] Connected devices
        ! No devices available
    
    ! Doctor found issues in 2 categories.
    

其他

  1. 如果还有什么报错的话,请贴具体报错信息上来哈

@DreamClimb
Copy link
Author

PS D:\GithubCode\wanandroid> flutter packages get
Running "flutter packages get" in wanandroid...
Because every version of flutter_test from sdk depends on http 0.12.0 and flutter_cache_manager ^0.1.0-rc.1 depends on
http ^0.11.3+14, flutter_test from sdk is incompatible with flutter_cache_manager ^0.1.0-rc.1.
And because cached_network_image ^0.4.2 depends on flutter_cache_manager ^0.1.2, flutter_test from sdk is incompatible
with cached_network_image ^0.4.2.
So, because wanandroid depends on both cached_network_image ^0.4.2 and flutter_test any from sdk, version solving
failed.

pub get failed (1)

@hurshi
Copy link
Owner

hurshi commented Nov 1, 2018

  1. @DreamClimb 应该是依赖库版本问题,我之前本地版本是0.9.4
  2. 我已经将我本地版本号升级到0.10.2,以及升级了依赖库的版本,应该可以编译了
  3. 有问题再贴出来哈

@hurshi hurshi added the help wanted Extra attention is needed label Nov 1, 2018
@gocnpan gocnpan mentioned this issue Mar 16, 2019
@hurshi hurshi closed this as completed Aug 12, 2019
@13120241790
Copy link

Exception in thread "main" java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567)
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469)
at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1274)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237)
at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727)
at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
at java.base/java.util.zip.ZipFile.(ZipFile.java:247)
at java.base/java.util.zip.ZipFile.(ZipFile.java:177)
at java.base/java.util.zip.ZipFile.(ZipFile.java:191)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Finished with error: Gradle task assembleDebug failed with exit code 1
这个问题遇到过吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants