본문 바로가기

개발하자

Fluter App이 "Gradle 작업 'assemblyDebug' 실행 중... "

반응형

Fluter App이 "Gradle 작업 'assemblyDebug' 실행 중... "

앱을 실행하면 막힙니다

Launching lib\main.dart on Lenovo A319 in debug mode...
Running Gradle task 'assembleDebug'...
(This is taking an unexpectedly long time.)

Gradle이나 종속성을 초기화하지 않습니다




이 문제는 여러 가지 문제 중 하나일 수 있으며 권장 문제 해결 방법 중 일부를 찾을 수 있습니다.

  1. 설치한 Android SDK를 기반으로 빌드 중인지 확인합니다... build.gradle 파일에서 compileSdkVersion을 확인하십시오.

  2. 관련 SDK 제거 및 재설치를 시도할 수 있습니다.

  3. 일부 사용자들은 다트를 다시 설치해야 했다고 보고했다.

조금 더 많은 정보가 없다면 기본적인 문제 해결이 최선입니다. 죄송합니다.

행운을 빌어요.




Flot에서 Android용 앱을 만드는 경우 이 문제가 발생할 수 있습니다. 나는 운 좋게도 이 문제에 직면했다. 해결할 수 있는 몇 가지 방법은 다음과 같습니다:

1. Due to androidX

여기서 권장 경로를 따른 경우:

다음을 수행하십시오:

나열된 모든 파일이 프로젝트와 동일한 경우, 특히 의 경우 위 튜토리얼에서 "권장되지 않음" 방법으로 단계를 확인합니다

감사합니다.




내 경우 Windows 방화벽이 이 문제를 야기했습니다. 내가 그것을 일시적으로 비활성화한 후에 그 문제는 사라졌다. 한번 해볼 만해요. 행운을 빕니다.




이 문제는 Zen 커널 때문에 내 시스템에서 발생했다.

나는 리눅스-LTS 커널을 설치하고 이것을 사용하여 시스템을 시작했다.

그리고 나서 내 프로젝트는 다시 컴파일하기로 되돌아갔다.




build.gradle 파일의 잘못된 컴파일SdkVersion으로 인해 동일한 문제가 발생했습니다. 지금은 잘 작동하고 있습니다.




Archlinux에 대한 두 가지 이유가 있었습니다:

  1. 나는 ()로 설정된 것이 필요했다.
  2. 어떤 이유에서인지 flot stability가 나에게 작동하지 않았다; 그래서 나는 다음과 같이 master로 전환했다: &&. fix in master가 stability()가 되면 flot stability로 다시 전환할 수 있을 것이다.



Ubuntu 18.04에서 VS Code를 사용하고 있습니다

나에게는 연결된 장치에 적합한 Android SDK 빌드 도구의 백그라운드 다운로드였다. 실행은 보통 시간이 걸리는 안드로이드 SDK 빌드 도구를 다운로드하고 있음을 보여주었다. 일단 완료되면, 플러터 앱이 컴파일되어 성공적으로 실행되었다.

해결책

  1. Android sdk 도구를 설치하고 환경 경로에 추가했는지 확인합니다. 나는 당신이 안드로이드 sdk 툴을 다운로드했다고 생각한다.

  2. 눈금을 설치하고 경로에 추가했는지 확인합니다

  3. 최신 다트 및 플러터 SDK를 설치했는지 확인하십시오

1번과 2번이 아닌 경우 다음 게시물을 참조하십시오:

Android 스튜디오 없이 플러터 설정




여기 제 경우의 해결책이 있습니다.

  1. 플러터 프로젝트 디렉토리를 엽니다.
  2. 플로터 프로젝트 디렉터리에서 디렉터리를 Android 디렉터리로 변경
  3. 깨끗한 그라데이션
  4. 그라데일을 작성하거나 두 명령을 결합할 수 있습니다
  5. 이제 당신의 설레임 프로젝트를 실행하세요. vscode를 사용하는 경우 F5를 누릅니다. assemblyDebug를 처음 실행하는 눈금은 시간이 걸립니다.

PS: 모든 단계가 작동하지 않을 경우 눈금 삭제




내 경우에는 구글 웹 드라이버를 다운로드하는 것을 잊었다. 구글 웹 드라이버를 다운로드하면 실행됩니다.




안드로이드 스튜디오가 기기(AVD)에 접속하려면 방화벽 허가가 필요해 윈도10에서 시간이 걸리고 있다. 당신이 당신의 기계에 전체 Android SDK를 다운로드하지 않은 또 다른 이유가 있을 수 있다. 문제를 확인하려면 터미널/cmd/PowerShell 명령 도구에서 명령을 실행하기만 하면 됩니다.

flutter doctor펄쩍펄쩍 뛰는 의사

SDK가 설치되어 있는지 확인하십시오. 다음 명령을 사용하여 라이센스 설치 및 수락 시도

flutter doctor --android-licenses

문제가 해결되지 않으면 Android Studio로 이동하여 Android Studio를 엽니다,

,

해당 페이지로 이동합니다.

틱을 해제합니다,

Apply를 선택하고 Apply를 누르면 편리한 다른 도구도 설치할 수 있습니다.




이것은 도움이 되었습니다. root/android/app/build.gradle SDK 버전이 다음에 대해 최소 28로 설정되어 있는지 확인하십시오. compileSdkVersion 28 및 targetSdkVersion 28

Firestore를 가져올 때 발생합니다.




Windows(윈도우)를 사용하는 경우 Android Studio에 방화벽 예외를 추가해 보십시오.

  1. 이동:
  2. 버튼을 누릅니다:
  3. 새 방화벽 예외 추가:

이것이 당신에게도 유용할 수 있기를 바랍니다.




나의 경우 안드로이드 그라들 플러그인 버전은 어떤 버전으로도 업데이트되지 않았다. 그래서 프로젝트 폴더를 마우스 오른쪽 단추로 클릭하고 "모듈 설정 열기"를 클릭하여 그라들 플러그인 버전을 업데이트했습니다.




프로젝트에서 "flutter clean" 명령을 사용했는데 완벽하게 작동했습니다. 시도해 보십시오.

flutter clean



내가 꼼짝 못하고 있다는 것을 보여주었다

Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip

다운로드 속도가 DSL 연결에서 ~10kB/s였기 때문에 이 작업은 몇 시간이 걸릴 것으로 예상되었습니다.

솔루션:

  1. 그라데이션 빌드 중단
  2. 예를 들어 에서 필요한 그라들 zip을 다운로드합니다.
  3. 복사 위치(PC의 마지막 폴더 이름은 물론 다름)
  4. 그리고 voila.



안녕하세요!

여러 번 시도했지만, 그들이 추천한 어떤 것도 나에게 효과가 없었다.

문제는 SQLite에서 처음에 SQL 생성 및 삽입 작업을 수행하기 위한 코드 행이 많은 *.dart 파일이 있다는 것이었습니다. 4072 줄의 작업을 제거하고 파일 크기를 줄였으며 더 이상 매우 긴 코드 파일을 컴파일할 필요가 없었습니다. 대신 데이터베이스를 자산에 미리 로드하면 완벽하게 작동했습니다..

작업이 오래 걸린다는 메시지가 더 이상 뜨지 않습니다, 도움이 되었으면 합니다.

이전, 긴 파일 크기일 때

이후, SQL 코드 작업 없음




나의 경우, 나는 안드로이드 SDK 빌드 도구를 업데이트해야 한다.

Android 스튜디오에서 엽니다. Android SDK Built-Tools를 표시하고 Apply를 누르고 업데이트를 기다립니다. 업데이트된 후 적용을 누르고 실행해 보십시오.

android SDK built-tools




Android Studio에서:

공구 -> 플레어 -> 플레어 클린.

그 후에 앱을 실행하세요




Android API용으로 SDK Platform을 Android studio에 재설치하여 문제를 해결하였습니다

Tools->SDK Manager-SDK Platform

다음은

Android > app > build.gradle

당신도 변해야 합니다

compileSdkVersion 29

targetSdkVersion 29

인내심을 가져, 첫 번째 발사는 더 오래 걸리니까...하지만, 전처럼 영원히 걸리지는 않아요.

행운을 빌어요




인터넷에 연결한 다음 Windows Defender/방화벽을 비활성화하십시오. 저한테 효과가 있어요.




내 LG G6에서도 같은 문제가 있다. 새로운 버전의 광고는 일부 LG 전화기의 호환성 문제를 추가한 것으로 보인다.

플랫폼 도구 버전 28.0.0으로 다운그레이드하면 문제가 해결되었습니다.

참조:

https://superuser.com/questions/1357708/android-adb-logcat-works-only-on-shell/1357929#1357929

https://github.com/flutter/flutter/issues/18889#issuecomment-421432066




드디어 고쳤어요. 이 문제는 주로 Android SDK 또는 Gradle 빌드 도구 때문입니다

당신이 그것을 고치려고 시도할 수 있는 다른 방법들이 있다. 방법 1. 구글 드라이버가 설치되어 있는지 확인하라. 당신은 안드로이드 스튜디오의 sdk 매니저에서 그것들을 찾을 수 있다

way 2. flot 의사-vflot 의사 --flot-disclass (#이것은 안드로이드의 모든 라이선스가 수락되었는지 여부를 확인할 것이다

방법 3. flottle clean; flutter build pk flottle run (처음에는 조립하는 데 시간이 걸리므로 7~10분 정도만 참아주세요)

방법 4. 이것도 작동하지 않으면 플레어 클린 플러터 실행(참고 5~10분 후에 에뮬레이터에서 플레어 코드가 실행됩니다)

이 해결책들이 당신에게 효과가 있기를 바랍니다, 만약 답장이 없다면.




터미널에서 프로젝트를 실행하는 동안 바이러스 백신을 꺼서 문제를 해결했습니다

터미널에서 프로젝트를 실행하려면 --> flash run을 입력하십시오




내 경우에는 그 문제가 해결되었다.

v10.15.4




이것은 나에게 효과가 있었다:

C:\Users<user>\안드로이드 스튜디오 프로젝트 <flutter_app>\android> C:\사용자<사용자>\Android Studio 프로젝트 <flutter_app>\android>

이제 초기 빌드를 위해 실행하십시오

“Running Gradle task 'assembleDebug'… ”

그 후 10-12분 정도면 갈 수 있을 거예요.




너 그거 CLI에서 해봤어?

펄럭이는 장치

펄럭펄럭 뛰다

https://timeout.dev/timeout/get-timeout/test-drive?탭=터미널

맥 환경에서 건축 공정은 140년대에 끝났다.




그리고나서




먼저 프로젝트를 닫고 다른 위치에 복사된 동일한 프로젝트를 엽니다. 그거야!!




  1. 고속 미러에서 필요한 그라들 zip을 다운로드합니다:

  2. gradle-5.6.2-all.zip을 C로 복사합니다:\Users.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16s49n74lgtbb

만약 이것이 작동하지 않는다면, 안드로이드 스튜디오의 터미널로 가서 실행:-flower run.

어떤 SDK 플랫폼을 요구하는지 확인해 보십시오. 예를 들어 SDK API 28, 29 또는 30과 같습니다. 그런 다음 SDK 관리자로 이동하여 필요한 SDK API를 설치합니다. 그런 다음 Android 스튜디오를 다시 시작합니다.

그것은 완벽하게 잘 작동할 것이다!!




프로젝트를 이미 열고 다른 새 프로젝트를 만든 경우 이미 실행 중인 프로젝트 버전을 기준으로 그라들 파일을 업데이트해야 합니다. 나의 경우 이전 프로젝트에 Gradle 5.6.4를 이미 설치했고 새 프로젝트를 만들 때 Gradle 래퍼 파일에 5.6.2가 있었습니다. 그래서 업데이트를 했어요.




이건 나한테 효과가 있었어.라이센스 승인 문제가 발생했습니다. 먼저 flot 디렉토리를 통과한 다음 명령을 실행해야 합니다

C:\Users\thrishool\flutterProjects\flutter>flutter doctor

그러면 모든 것이 정상인지 아닌지 표시됩니다.나는 모든 면허증을 받지 않았다는 문제가 생겼다.그래서 당신은 그것들을 모두 받아들여야 합니다.이제 cmd로 입력합니다

C:\Users\thrishool\flutterProjects\flutter>flutter doctor --android-licenses

Accept all the licenses and you are good to go.




For me what worked was clean wipe the emulator data by AVD Manager

Wipe data by AVD Manager




I stumbled on this problem when I was running my app without debugging it. Theres two option

  1. Start Debugging
  2. Run without Debugging

I was doing the second option the whole time which got me stuck in that running graddle loop. I fixed my problem with the first option.




If Running Gradle task assembledebug is taking unexpectedly long time, try updating Gradle in your project. (Downloading latest zip file)

You can follow steps in this answer.

Or try by:

  1. Open a project in Android Studio
  2. Right-click on android in Projects Panel
  3. Go down to Flutter and click on the 'Open Android module in Android Studio'.

(See screenshot for reference)

Steps 1 to 3

This should open the project as an Android Project.

  1. Now, click on 'gradle' in the right panel.
  2. Next, click on 'Execute Gradle Task' icon

Steps 4 and 5

This should open a 'Run Anything' window.

  1. Now, Run the command gradlew clean
  2. and, then run gradlew build
  3. If prompted by Android Studio to 'Update Gradle Plugin', do that.

Update Gradle Plugin

The update would download the required .zip files. And, your apps should work fine after that.




If Running Gradle task assembledebug is taking unexpectedly long time and if its not working even after checking the solutions mentioned in this article.

Just go and create new virtual device in AVD Manager. I hope this will definitely work for you.




In my case, the issue was, project_path contained "space".

Example:

~/New Folder/myProject

Check if you have this issue.




The same problem occurred on my mac in Android Studio 4.1, unfortunately, I forgot to install Java on my machine, try installing Java.




the problem is solved using following:

  1. in android studio tools--> sdk Manager --> android sdk--> sdk platforms. dowload android sdk platform 28 dowload android sdk platform 28

now re-run ur project




nothing was working for me

I do update the flutter SDK & update all the dependencies to the latest version. after that, I open the android module as a project in android studio. It downloads some files. after completion, I do clean the project using Build->clean Project & update the Gradle version.

After that, I again open the flutter project and run the app. It's working now.... :)




This might also be due to developers permission, if you will be using any package which requires devices permission lets say url_launcher and you haven't given permission for that it wont run. Solution for windows is that just run ms-settings:developers this in your command prompt/ powershell and enable for developers option and then it will work fine. and if that doesnt also works then just run flutter clean and flutter create . it will work.




I fixed this with upgrading flutter version from 2.0.5 to 2.2.0.




For me simply the process took too much time. It kept running for about 10 mins and finally the app started running.




if u are using windows 10, open your project in the terminal, and write these commands:

  1. cd android
  2. gradlew clean
  3. gradlew build

then run the project.

Note: if u face a problem like no path for JAVA_HOME so set this path C:\Program Files\Android\Android Studio\jre in the environment variable. and open project structure in android studio and set the same path in JDK path.




Can run the flutter app in profile / release mode to launch the app quickly. Note: We suppose to relax the hot reload. mode details

select profile mode run




This solution should be working for some cases:

1 - Download Google Web Driver in Android SDK.

2 - Update Dart And Flutter in IntelliJ Idea or Android Studio or VS Code plugin.

3 - Run again.




I had the same challenge, meanwhile, doing flutter clean, flutter doctor, download gradle didn't help me and my issue stayed again. Finally the bellow steps rescued me from this trap.

1)Create a new flutter project(File--> new flutter project)
2)Transfer Lib, assets, font, pubspec.yaml, pubspec.lock 
3)pub update in pubspec.yaml of new project
4) change the kotlin version to latest version like 1.5.10 in android/build.gradle path in new project.

At the end try to rebuild your project and solve the other tiny problems which maybe occur. For instance, in my project the mentioned steps help me precisely.




Had this issue today, every solution I found didn't work. In my case, I had to update Windows, after installing every update they listed and then restarting pc, the problem disappeared.




I had the same issue for almost half a day, so what I did :

  • Go to my Home directory, enabled show hidden folders.
  • Delete the .gradle folder.
  • Went back to Android studio, opened the terminal, and ran the flutter run command.
  • After it completes, the app will be launched on your connected device.

Note: Make sure you have a strong internet connection because gradle files are going to be re-downloaded.

Thank you, hope this one helps




On android studio go to file/invalidate caches/

For me this works




for me, I just changed my proxy, while I have problem on sync gradle files on my country.




1: If it is the first launch, please be patient since it will download all gradle files for the first time.

2: To know if it really stuck, take help from the task manager in windows or the activity monitor on Mac, and check if the process is really using some CPU or network or not. If not, it is stuck. If it is using some resources, please be patient then (it should take ~5-40 minutes normally, even if you have slower internet).

3: If it is really suck, stop the process and run ./gradlew clean before building it next time.


반응형