自从我收到com.android.builder.internal.aapt.v2.Aapt2Exception异常以来,我最近将Android Studio更新到了3.2版 我研究了关于stackoverflow的解决方案,但找不到合适的解决方案。
错误消息所提示的可绘制文件已经存在,并且在我将android studio更新到最新版本3.2.1之前,项目运行良好
错误:
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: warn: removing resource com.example.mohit.chatapp:string/com_facebook_loginview_logged_in_using_facebook_f1gender without required default value.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:25: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:49: error: resource drawable/message_back (aka com.example.mohit.chatapp:drawable/message_back) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_main.xml:54: error: resource drawable/fb (aka com.example.mohit.chatapp:drawable/fb) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_splash_screen.xml:10: error: resource drawable/ic_place_black_24dp (aka com.example.mohit.chatapp:drawable/ic_place_black_24dp) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:19: error: resource drawable/profilepicture (aka com.example.mohit.chatapp:drawable/profilepicture) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:58: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:152: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:169: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:3: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
error: failed linking file resources.
Command: C:\Users\Mohit\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\1558dd943061657e6b17ed05cad5fd2f\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\Mohit\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
E:\andriodProjects\ChatApp\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
E:\andriodProjects\ChatApp\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@E:\andriodProjects\ChatApp\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
E:\andriodProjects\ChatApp\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--proguard-main-dex\
E:\andriodProjects\ChatApp\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
--custom-package\
com.example.mohit.chatapp\
-0\
apk\
--output-text-symbols\
E:\andriodProjects\ChatApp\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Output: warn: removing resource com.example.mohit.chatapp:string/com_facebook_loginview_logged_in_using_facebook_f1gender without required default value.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:25: AAPT: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:49: AAPT: error: resource drawable/message_back (aka com.example.mohit.chatapp:drawable/message_back) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_main.xml:54: AAPT: error: resource drawable/fb (aka com.example.mohit.chatapp:drawable/fb) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_splash_screen.xml:10: AAPT: error: resource drawable/ic_place_black_24dp (aka com.example.mohit.chatapp:drawable/ic_place_black_24dp) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:19: AAPT: error: resource drawable/profilepicture (aka com.example.mohit.chatapp:drawable/profilepicture) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:58: AAPT: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:152: AAPT: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:169: AAPT: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:3: AAPT: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: AAPT: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
error: failed linking file resources.
Command: C:\Users\Mohit\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\1558dd943061657e6b17ed05cad5fd2f\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\Mohit\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
E:\andriodProjects\ChatApp\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
E:\andriodProjects\ChatApp\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@E:\andriodProjects\ChatApp\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
E:\andriodProjects\ChatApp\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--proguard-main-dex\
E:\andriodProjects\ChatApp\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
--custom-package\
com.example.mohit.chatapp\
-0\
apk\
--output-text-symbols\
E:\andriodProjects\ChatApp\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteException(Aapt2ErrorUtils.kt:97)
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteLinkException(Aapt2ErrorUtils.kt:73)
at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:527)
at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTaskAction(LinkApplicationAndroidResourcesTask.java:275)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.GeneratedMethodAccessor224.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 33 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: warn: removing resource com.example.mohit.chatapp:string/com_facebook_loginview_logged_in_using_facebook_f1gender without required default value.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:25: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_chat_box.xml:49: error: resource drawable/message_back (aka com.example.mohit.chatapp:drawable/message_back) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_main.xml:54: error: resource drawable/fb (aka com.example.mohit.chatapp:drawable/fb) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\activity_splash_screen.xml:10: error: resource drawable/ic_place_black_24dp (aka com.example.mohit.chatapp:drawable/ic_place_black_24dp) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:19: error: resource drawable/profilepicture (aka com.example.mohit.chatapp:drawable/profilepicture) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:58: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:152: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\layout\fragment_profile.xml:169: error: resource drawable/white_view (aka com.example.mohit.chatapp:drawable/white_view) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:3: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
E:\andriodProjects\ChatApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: error: resource drawable/ic_launcher_background (aka com.example.mohit.chatapp:drawable/ic_launcher_background) not found.
error: failed linking file resources.
Command: C:\Users\Mohit\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\1558dd943061657e6b17ed05cad5fd2f\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\Mohit\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
E:\andriodProjects\ChatApp\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
E:\andriodProjects\ChatApp\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@E:\andriodProjects\ChatApp\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
E:\andriodProjects\ChatApp\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--proguard-main-dex\
E:\andriodProjects\ChatApp\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
--custom-package\
com.example.mohit.chatapp\
-0\
apk\
--output-text-symbols\
E:\andriodProjects\ChatApp\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:177)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:103)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:176)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:823)
at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:525)
... 49 more