program story

오류 : ': app : processDebugResources'작업에 대한 실행이 실패했습니다.

inputbox 2020. 11. 22. 19:27
반응형

오류 : ': app : processDebugResources'작업에 대한 실행이 실패했습니다. > java.io.IOException : Android 스튜디오에서“”폴더를 삭제할 수 없습니다.


Android Studio를 사용하여 Android 애플리케이션을 개발하려고해서 Android 앱을 만들고 게시하고 싶습니다. apk 파일을 얻기 위해 "build project"를 클릭 할 때마다 다음 오류가 발생합니다.

Error:Execution failed for task ':app:processDebugResources'.
> java.io.IOException: Could not delete folder C:\Users\ehsan\AndroidStudioProjects\MyApplication3\app\build\generated\source\r\debug\com\example\ehsan

오류 메시지를 보여주는 스크린 샷

Build.gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.ehsan.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
}

대상 빌드 디렉토리의 일부 파일이 사용하는 다른 도구에서 열려 있다고 생각합니다. 정리해야 할 폴더에 파일 핸들이 열려 있습니다. 빌드 작업 'clean'은 빌드 디렉토리 (일반적으로 'target')의 모든 파일을 삭제하려고하며 실패하면 빌드가 실패합니다.


반응 네이티브

반응 기본 폴더에서 다음을 실행하십시오.

cd android && gradlew clean

그때

cd .. && react-native run-android

메모:

Mac의 경우 다음으로 변경해야 할 수 있습니다 gradlew../gradlew

명령 프롬프트를 들어 당신은을 변경해야 할 수도 있습니다 &&&

For powershell you may need to change the && to ; and gradlew to .\gradlew.bat

Each command can also be run individually like so cd android then gradlew clean then cd .. then react-native run-android


Just clean your project, it works for me.

Clean task for gradle will work.


Fix is very simple: Just follow below instructions

  1. First, save the project
  2. Click on project folder
  3. Click on Syncronize button in the menubar (The third icon from the left which is just below to File menu option)
  4. Clean project and run

as others have said allready you need to clean your project , the steps to clean the project are:

Build -> Clean Project or Build -> Rebuild Project


In my case, that problem is about permissions. if you open android studio as administrator (or using sudo) then if you open the project again as normal user, android studio may not delete some files because when you open the project as administrator, some project files permissions are changed. If you lived those steps, I think you should clone the project from your VCS (git, tfs, svn etc.) again. Otherwise you have to configure project file - folder permissions.


I have same issue. When I clean my project and rebuild it then everything works fine.

Build -> Clean Project


Just clean your project (Android Studio>Build>Clean Project) and build again.


I found another handy solution, which avoids rebuilding all components again and again, in this article: http://bitstopixels.blogspot.ca/2017/04/react-native-windows-10-eperm-operation.html

  1. Execute react-native run-android
  2. As soon as React Packager window opens, close it
  3. Wait for react-native run-android to complete giving you the BUILD SUCCESSFUL message. (The app will be launched with a red error screen complaining connecting to server failed. Don't panic.)
  4. Then run react-native start to start the React Packager, this is the server indicated in the error message of the previous step
  5. Reload the app in emulator or device (Double tap the R key)

If you encountered these error due to opening android studio with sudo command. Then solution is setting permission for the project folder. In my case, I run the command below.

sudo chmod -R 777 your_project_folder

clean and rebuild again your android project.


Fix This issue by this command

In Windows Platform

cd android && gradlew clean && cd..

In Mac Platform

cd android && ./gradlew clean && cd ..


React Native

These steps solved my problem:

  • Renaming of ReactNativeApp/android/build directory to old.build
  • Closing Android Studio
  • Inside ReactNativeApp/android executed this command. gradlew clean
  • Making sure my RAM is 1500mb free
  • Then finally executing the command react-native run-android

** It's quite interesting to close Android Studio. But beleive me these steps solved my problem **


Stopping OpenSdk Java process (inner to Android Studio process) worked.


If you have another instance of Android Studio running, then kindly close it and then build the app. This worked in my case


Update your gradle version.

Go to your project level build.gradle file and make sure you are using the latest version of gradle.


React Native

In my case I just refresh ( http://localhost:8081/debugger-ui/ ) , and it works... Any other solutions didn't work for me. Perhaps some files are used by debuger and it can't delete them... Anyway, it works for me. Please try this and give a feedback.


If it says:

The term 'gradlew' is not recognized

Then using following command

npm start -- --reset-cache

worked for me. cheers!


Delete android/app/build folder and run react-native run-android


From my experience in React Native, you can also restart your CLI and this error goes away.


If you are using macOS then => sudo ./gradlew clean will work for you.


Just Do onething File->Invalidate caches/ restart. After loading the project sync the project.여기에 이미지 설명 입력

참고URL : https://stackoverflow.com/questions/35674066/errorexecution-failed-for-task-appprocessdebugresources-java-io-ioexcept

반응형