本文介绍了Android Studio 3.0清单错误:未知元素&lt; action&gt;成立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 拥有一个由Android Studio 2.3很好地构建的应用程序.更新Android Studio 3.0 稳定后,开始出现此错误,无法构建我的项目.这是我的manifest.xml <application android:name=".ApplicationClass" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:theme="@style/AppTheme"> <!--other unrelated stuff--> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.xxx.xxx" /> </intent-filter> </receiver></application>错误显示此行:<action android:name="com.google.android.c2dm.intent.REGISTRATION" />如果我评论/删除此动作标签行,则该项目可以正常运行,但对于GCM是必需的,而我无法删除它.如您所见,日志未在主清单文件中发生,在/build/intermediates/manifests/full/debug/AndroidManifest.xml中发生了错误 >尝试清洁,重建,禁用即时运行.有什么解决办法吗? 错误日志: /THE_PROJECT_PATH/app/build/intermediates/manifests/full/debug/AndroidManifest.xmlError:(99) error: unknown element <action> found.Error:(99) unknown element <action> found.Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:Execution failed for task ':app:processDebugResources'.> Failed to execute aaptInformation:BUILD FAILED in 1sInformation:6 errorsInformation:0 warningsInformation:See complete output in console解决方案标签位置错误.现在,新的AAPT(AAPT2)对此引发了错误.来自此处的文档: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html Have an application which was building by Android Studio 2.3 fine.After updating Android Studio 3.0 Stable, started to having this error and unable to build my project.Here my manifest.xml<application android:name=".ApplicationClass" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:theme="@style/AppTheme"> <!--other unrelated stuff--> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.xxx.xxx" /> </intent-filter> </receiver></application>Error shows this line:<action android:name="com.google.android.c2dm.intent.REGISTRATION" />If I comment/remove this action tag line, the project builds fine but it is necessary for GCM and I cannot remove it.As you see the logs, The error not occurs at main manifest file, occurs at /build/intermediates/manifests/full/debug/AndroidManifest.xmlTried cleaning, rebuilding, disabling instant run. Is there any solution?The Error Logs:/THE_PROJECT_PATH/app/build/intermediates/manifests/full/debug/AndroidManifest.xmlError:(99) error: unknown element <action> found.Error:(99) unknown element <action> found.Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsError:Execution failed for task ':app:processDebugResources'.> Failed to execute aaptInformation:BUILD FAILED in 1sInformation:6 errorsInformation:0 warningsInformation:See complete output in console 解决方案 You have a misplaced tag. The new AAPT (AAPT2) now throws an error on this.From the docs in here: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html 这篇关于Android Studio 3.0清单错误:未知元素&lt; action&gt;成立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-30 00:57