首页 > 系统相关 >archlinux flutter开发踩坑

archlinux flutter开发踩坑

时间:2024-02-10 22:44:09浏览次数:27  
标签:tools unspecified gradle 7.3 archlinux 开发 android com flutter

archlinux flutter开发踩坑

archlinux是个好东西,但是开发flutter坑不少。2023年5月我配置了flutter,后来用得不多,23年11月还尝试过但是失败,最近又要使用,就来解决下。

20230210

今天需要写一个手机app,突然发现构建不出来了,报错

> Failed to create parent directory '/opt/flutter/packages/flutter_tools/gradle/.gradle' when creating directory '/opt/flutter/packages/flutter_tools/gradle/.gradle/buildOutputCleanup'

* 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 48s
Exception: Gradle task assembleDebug failed with exit code 1

你他妈别说,这问题还麻烦,只看这个还看不出来

先sudo运行一下,运行的时候保留环境变量

sudo -E flutter run

失败了,同样问题。然后单独在Android下面跑一个./gradlew clean

报错

Welcome to Gradle 7.5! Here are the highlights of this release: - Support for Java 18 - Support for building with Groovy 4 - Much more responsive continuous builds - Improved diagnostics for dependency resolution For more details see https://docs.gradle.org/7.5/release-notes.html Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details FAILURE: Build failed with an exception. * Where: Settings file '/home/client/android/settings.gradle' line: 25 * What went wrong: Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0'] > A problem occurred configuring project ':gradle'. > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository(). > java.io.FileNotFoundException: /opt/flutter/packages/flutter_tools/gradle/.gradle/buildOutputCleanup/buildOutputCleanup.lock (权限不够) * 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 1s

写的很明显权限不够,给当前用户上权限

sudo chown -R $(whoami) /opt/flutter

再次运行

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration 'classpath'.
> Could not resolve com.android.tools:sdk-common:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > com.android.tools.lint:lint-model:30.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder:7.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder:7.3.0 > com.android.tools.build:manifest-merger:30.3.0
   > Could not resolve com.android.tools:sdk-common:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.3.0/sdk-common-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.3.0/sdk-common-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools:sdklib:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder:7.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder:7.3.0 > com.android.tools.build:manifest-merger:30.3.0
   > Could not resolve com.android.tools:sdklib:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/sdklib/30.3.0/sdklib-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/sdklib/30.3.0/sdklib-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools:repository:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools:repository:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/repository/30.3.0/repository-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/repository/30.3.0/repository-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools.build:aaptcompiler:7.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools.build:aaptcompiler:7.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aaptcompiler/7.3.0/aaptcompiler-7.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aaptcompiler/7.3.0/aaptcompiler-7.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools.lint:lint-typedef-remover:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools.lint:lint-typedef-remover:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-typedef-remover/30.3.0/lint-typedef-remover-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-typedef-remover/30.3.0/lint-typedef-remover-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.databinding:baseLibrary:7.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0 > androidx.databinding:databinding-compiler-common:7.3.0
   > Could not resolve com.android.databinding:baseLibrary:7.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/7.3.0/baseLibrary-7.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/7.3.0/baseLibrary-7.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools.utp:android-device-provider-ddmlib-proto:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools.utp:android-device-provider-ddmlib-proto:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-device-provider-ddmlib-proto/30.3.0/android-device-provider-ddmlib-proto-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-device-provider-ddmlib-proto/30.3.0/android-device-provider-ddmlib-proto-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-additional-test-output-proto/30.3.0/android-test-plugin-host-additional-test-output-proto-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-additional-test-output-proto/30.3.0/android-test-plugin-host-additional-test-output-proto-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake
> Could not resolve com.android.tools.utp:android-test-plugin-host-retention-proto:30.3.0.
  Required by:
      unspecified:unspecified:unspecified > com.android.application:com.android.application.gradle.plugin:7.3.0 > com.android.tools.build:gradle:7.3.0
   > Could not resolve com.android.tools.utp:android-test-plugin-host-retention-proto:30.3.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-retention-proto/30.3.0/android-test-plugin-host-retention-proto-30.3.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-retention-proto/30.3.0/android-test-plugin-host-retention-proto-30.3.0.pom'.
            > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
               > Remote host terminated the handshake

* 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 54s
4 actionable tasks: 4 executed

网络问题,先看一下java版本

java -version 
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)

可以显式地配置Gradle使用TLS协议,在gradle.properties文件

systemProp.jdk.tls.client.protocols=TLSv1.2,TLSv1.3

这个时候./gradlew clean可以正常工作了,但是./gradlew assembleDebug 不能正常工作

这个时候,我打开了Android studio, it words!

标签:tools,unspecified,gradle,7.3,archlinux,开发,android,com,flutter
From: https://www.cnblogs.com/studyinglover/p/18013087

相关文章

  • 鸿蒙开发游戏(二)---大鱼吃小鱼(摇杆控制)
    鸿蒙开发游戏(一)---大鱼吃小鱼(界面部署)鸿蒙开发游戏(二)---大鱼吃小鱼(摇杆控制)鸿蒙开发游戏(三)---大鱼吃小鱼(放置NPC)鸿蒙开发游戏(四)---大鱼吃小鱼(互吃升级)鸿蒙开发游戏(五)---大鱼吃小鱼(添加音效)鸿蒙开发游戏(六)---大鱼吃小鱼(称霸海洋) 前言:上一篇介绍了鸿蒙新建项目以及界面部署......
  • Qt6.0开发 第二章 GUI程序设计基础
    第二章GUI程序设计基础窗口相关文件按照第一章所给提示创建一个新project,我们得到了下面的代码:widget.h:#ifndefWIDGET_H#defineWIDGET_H#include<QWidget>QT_BEGIN_NAMESPACEnamespaceUi{classWidget;}QT_END_NAMESPACEclassWidget:publicQWidget{......
  • [Kyana]Linux内核开发记录
    01|修的内核bug如何推进发patch克隆最新代码,确定问题还存在新建本地分支,修改要修改的部分gitadd修改的文件gitcommit-scommit-log《标题》:修改的大类:简短的patch主要描述《空行》《详细描述》gitformat-patch-1(可以在三小短线下写点东西)使用get-maintain......
  • Node.js+Express+Koa2开发接口学习笔记(六)
    预防sql注入sql注入最原始、最简单的攻击,从有了web2.0就有了sql注入攻击攻击方式:输入一个sql片段,最终拼接成一段攻击代码预防措施:使用mysql的escape函数处理输入内容即可例如登录,访问http://localhost:8080/login.html正常情况下是输入正确的用户名和密码来进行登录,这个登......
  • Express+Koa2开发接口学习笔记(五)
    日志介绍日志可以记录系统的日常和错误行为系统日志有2种类型:①访问日志accesslog(server端最重要的日志)②自定义日志(包括自定义事件、错误记录等)系统日志通常是写在一个文件中,而不是写进Mysql或者redis中。nodejs文件操作新建一个项目file-text在目录下创建test.js和data......
  • 基于.NetCore开发博客项目 StarBlog - (31) 发布和部署
    前言StarBlog第一期规划的功能基本完成了,我想着在春节前应该可以把第一期的系列文章完结掉,那么在差缺补漏阶段就剩下开发项目的最后一个环节——部署了。PS:事实上,还有一个很重要但又经常被略过的测试环节我们没有提到,因为时间关系,第一期规划我没有写单元测试和集成测试,在开......
  • Asp-Net-Core学习笔记:WebApi开发实践
    前言用AspNetCore做Api开发也有一段时间了,正好年底在做总结,做一个WebApi开发实践笔记。暂时想到的一些技术关键词,同时也作为本文的大纲,现在对这套技术体系的了解还不够深入,以后会持续更新这个Api开发实践~身份认证:JwtBearer分页:X.PagedList缓存ResponseCacheRedis:St......
  • Asp-Net-Core学习笔记:3.使用SignalR实时通信框架开发聊天室
    SignalR牛刀小试在MVP杨老师的博客里看到这么个东西,我还以为是NetCore3才推出的新玩意,原来是已经有很多年的历史了,那看来还是比较成熟的一个技术了。简介SignalR是一个.NETCore/.NETFramework的开源实时框架,SignalR的可使用WebSocket,ServerSentEvents和LongPolling......
  • 使用 Kestrel 自托管https 并作为 Windows 服务启动 Blazor 提示: 无法配置 HTTPS 端
    原文链接https://stackoverflow.com/questions/53300480/unable-to-configure-https-endpoint-no-server-certificate-was-specified-and-the/71026252#71026252使用Kestrel自托管并作为Windows服务启动Blazor提示UnabletoconfigureHTTPSendpoint.Noservercertifi......
  • 安装 Flutter 开发环境
    前言学习玩dart你会发现很神奇的事情这个dart就很无解,集Java,js,TS,爱了爱了然后就是安装Flutter就是顺手到来的事了 下载FlutterSDK包 官网下载插件https://flutter.dev/docs/get-started/install/macos配置环境变量压缩包下载好以后,找个位置进行解压。这个位......