1

For 2 days ago, I got the following error:

Executing tasks: [:app:assembleDebug]

Configure project :app registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Task :app:buildInfoDebugLoader Task :app:preBuild UP-TO-DATE Task :core:preBuild UP-TO-DATE Task :core:preDebugBuild UP-TO-DATE Task :core:checkDebugManifest Task :core:processDebugManifest Task :app:preDebugBuild Task :core:compileDebugAidl NO-SOURCE Task :app:compileDebugAidl NO-SOURCE Task :core:packageDebugRenderscript NO-SOURCE Task :app:compileDebugRenderscript NO-SOURCE Task :app:checkDebugManifest Task :app:generateDebugBuildConfig Task :app:prepareLintJar UP-TO-DATE Task :app:writeDebugApplicationId

Task :app:processDebugGoogleServices Parsing json file: /media/dr/2DD53B9005F868921/.androidProgects/answerVet/app/google-services.json

Task :app:generateDebugSources Task :core:compileDebugRenderscript NO-SOURCE Task :core:generateDebugBuildConfig Task :core:generateDebugResValues Task :core:generateDebugResources Task :core:packageDebugResources Task :core:generateDebugRFile Task :core:prepareLintJar UP-TO-DATE Task :core:generateDebugSources Task :core:javaPreCompileDebug

Task :core:compileDebugJavaWithJavac FAILED /media/dr/2DD53B9005F868921/.androidProgects/answerVet/core/src/main/java/com/ask/core/activities/audioDetailsActivity/AudioController.java:159: error: cannot find symbol final int recordIcon = R.drawable.ic_record_audio; ^ symbol: variable ic_record_audio location: class drawable

//many lines of can't find symbol

then :

Task :app:buildInfoGeneratorDebug FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':core:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details.

In the AudioController.java:159, there is no error and the icon is displayed beside the line.

I had tried all the suggested answers in the similar questions:

  1. clean project.
  2. invalidate and restart.
  3. delete build directory.
  4. inspect code and correct all errors.
  5. solve all errors and warning in the manifest file.

Edit I am using firebase in my project. the following din't solve the proplem.

classpath ('com.google.firebase:firebase-plugins:1.1.0') {
    exclude group: 'com.google.guava', module: 'guava-jdk5'
    }
tabebqena
  • 1,204
  • 1
  • 13
  • 23
  • Can you open the generated R java file and check if that symbol exists? – m0skit0 Jun 22 '19 at 16:13
  • Possible duplicate of [RegisterResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)](https://stackoverflow.com/questions/46984770/registerresgeneratingtask-is-deprecated-use-registergeneratedfoldersfilecollec) – Mohammad Sommakia Jun 22 '19 at 16:13

1 Answers1

0

That is how this error gone, It may help someone.

I commented all drawable that android studio complain from them. then it starts to complain from other files. In my case; there is style file that has malformed format.

<?xml version="1.0" encoding="utf-8"?>

<?xml version="1.0" encoding="utf-8"?>
  <selector xmlns:android="http://schemas.android.com/apk/res/android">
  ....  
</selector>

Other things I did may play a role for other cases:

  1. migrate to androidx ( hard job )
  2. upgrade gradle wrapper and plug in to latest Beta version.
  3. for who are using firebase, adding the following lines to the project.gradle is suggested here.

classpath ('com.google.firebase:firebase-plugins:1.1.0') { exclude group: 'com.google.guava', module: 'guava-jdk5' }

tabebqena
  • 1,204
  • 1
  • 13
  • 23