Flutter新鲜项目使用lint-gradle-api.jar出错(com.android.tools.lint:lint-gradle-api:26.1.2)

时间:2018-11-04 13:48:19

标签: android android-studio android-gradle flutter jcenter

我刚刚在Android Studio中为Flutter创建了一个新项目。 现在我得到了这个奇怪的错误:

  

在调试模式下为x86构建的Android SDK上启动lib \ main.dart ...   初始化gradle ...解决依赖关系...   *运行Gradle时出错:从以下位置退出代码1:C:\ Users \ bruker \ AndroidStudioProjects \ flutter_app \ android \ gradlew.bat   app:properties:项目评估失败,其中包括错误   afterEvaluate {}。使用--stacktrace运行以获取详细信息   afterEvaluate {}错误。

     

失败:构建失败,并出现异常。

     
      
  • 其中:构建文件'C:\ Users \ bruker \ AndroidStudioProjects \ flutter_app \ android \ app \ build.gradle'   行:25

  •   
  • 出了什么问题:评估项目':app'时出现问题。

         
        

    无法解析配置'classpath'的所有文件。     找不到lint-gradle-api.jar(com.android.tools.lint:lint-gradle-api:26.1.2)。      在以下位置搜索:          https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

      
  •   
  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。

  •   
  • https://help.gradle.org

  • 获得更多帮助   
     

在0秒内失败

     

完成错误:请在以下位置查看您的Gradle项目设置:   android /文件夹。

我读到您应该添加一些Maven依赖关系,但是我根本不使用Maven。这是我的build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我不在项目中使用maven。

.packages文件:

# Generated by pub on 2018-11-04 18:57:06.695056.
analyzer:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.32.4/lib/
args:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/args-1.5.0/lib/
async:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/async-2.0.8/lib/
boolean_selector:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
charcode:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
collection:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/collection-1.14.11/lib/
convert:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convert-2.0.2/lib/
crypto:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/crypto-2.0.6/lib/
csslib:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/csslib-0.14.5/lib/
cupertino_icons:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cupertino_icons-0.1.2/lib/
flutter:file:///C:/Users/bruker/flutter/packages/flutter/lib/
flutter_test:file:///C:/Users/bruker/flutter/packages/flutter_test/lib/
front_end:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/front_end-0.1.4/lib/
glob:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/glob-1.1.7/lib/
html:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/html-0.13.3+3/lib/
http:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http-0.11.3+17/lib/
http_multi_server:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/
http_parser:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/
io:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/io-0.3.3/lib/
js:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/
json_rpc_2:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/json_rpc_2-2.0.9/lib/
kernel:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/kernel-0.3.4/lib/
logging:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/logging-0.11.3+2/lib/
matcher:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/
meta:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/meta-1.1.6/lib/
mime:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/mime-0.9.6+2/lib/
multi_server_socket:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/multi_server_socket-1.0.2/lib/
node_preamble:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/node_preamble-1.4.4/lib/
package_config:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/package_config-1.0.5/lib/
package_resolver:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/package_resolver-1.0.4/lib/
path:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/path-1.6.2/lib/
plugin:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/plugin-0.2.0+3/lib/
pool:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pool-1.3.6/lib/
pub_semver:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pub_semver-1.4.2/lib/
quiver:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/quiver-2.0.0+1/lib/
shelf:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf-0.7.3+3/lib/
shelf_packages_handler:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_packages_handler-1.0.4/lib/
shelf_static:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_static-0.2.8/lib/
shelf_web_socket:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.2+4/lib/
sky_engine:file:///C:/Users/bruker/flutter/bin/cache/pkg/sky_engine/lib/
source_map_stack_trace:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_map_stack_trace-1.1.5/lib/
source_maps:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_maps-0.10.7/lib/
source_span:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_span-1.4.1/lib/
stack_trace:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/
stream_channel:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stream_channel-1.6.8/lib/
string_scanner:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/string_scanner-1.0.4/lib/
term_glyph:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/term_glyph-1.0.1/lib/
test:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/test-1.3.0/lib/
typed_data:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/
utf:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/utf-0.9.0+5/lib/
vector_math:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/
vm_service_client:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service_client-0.2.6/lib/
watcher:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/watcher-0.9.7+10/lib/
web_socket_channel:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/web_socket_channel-1.0.9/lib/
yaml:file:///C:/Users/bruker/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/yaml-2.1.15/lib/
flutter_app1:lib/

0 个答案:

没有答案