问题描述
我正在使用从 codecanyon.net 下载的项目,该项目在 Gradle 构建失败并显示错误消息.我试着用类似的问题回顾其他问题,但没有一个对我有用.请任何人都可以帮我解决这个问题
原因:重复条目:AndroidManifest.
下面是清单文件
<活动android:name=".activities.MainActivity";android:launchMode="singleTop";android:screenOrientation="肖像"android:windowSoftInputMode=stateHidden|adjustResize"/><活动android:name=".activities.ChatActivity";android:parentActivityName=.activities.MainActivity"android:screenOrientation="肖像"android:windowSoftInputMode=stateHidden|adjustResize"><!--android:windowSoftInputMode="stateHidden|adjustResize|adjustPan">--><元数据android:name="android.support.PARENT_ACTIVITY";android:value=.activities.MainActivity"/></活动><activity android:name=".activities.ImageViewerActivity";/><服务android:name=".services.FirebaseChatService";机器人:启用=真"/><service android:name=".services.MyFirebaseMessagingService"><意图过滤器><action android:name="com.google.firebase.MESSAGING_EVENT"/></意图过滤器></服务><接收器android:name=".receivers.ConnectivityReceiver";机器人:启用=真"><意图过滤器><action android:name="android.net.conn.CONNECTIVITY_CHANGE";工具:忽略=电池寿命";/></意图过滤器></接收器><!-- https://developers.google.com/places/android-sdk/signup --><元数据android:name=com.google.android.geo.API_KEY"android:value="@string/google_maps_key";/><提供者android:name=".utils.MyFileProvider";android:authorities="@string/authority";android:exported="false";android:grantUriPermissions="true";工具:替换=机器人:权威"><元数据android:name=android.support.FILE_PROVIDER_PATHS"android:resource="@<意图过滤器><action android:name="android.intent.action.MAIN";/><category android:name="android.intent.category.LAUNCHER";/></意图过滤器></活动><服务android:name=".services.FetchMyUsersService";android:exported="false";/><服务android:name=".services.SinchService";机器人:启用=真"android:exported="false";/><活动android:name=".activities.ChooseSignInActivity";机器人:标签=@string/title_activity_choose_sign_in";android:theme="@style/AppTheme";/><活动android:name=".activities.ContactActivity";android:screenOrientation="肖像"android:windowSoftInputMode=stateHidden|adjustResize"/><活动android:name=.activities.PrivacyPolicyActivity"android:screenOrientation="肖像"android:windowSoftInputMode=stateHidden|adjustResize"/><元数据android:name=com.dreams.chat.status.glideProgressBar.OkHttpProgressGlideModule"android:value=GlideModule"/><活动android:name=".activities.StatusStoriesActivity";android:exported="true"android:screenOrientation="肖像"android:theme="@style/FullScreenVideoTheme";/><活动android:name=.activities.CallListActivity"android:screenOrientation="肖像"android:windowSoftInputMode=stateHidden|adjustResize|adjustPan"/></应用程序></清单>
这是详细的例外
FAILURE:构建失败,出现异常.* 什么地方出了错:任务:app:mergeDebugAssets"执行失败.>无法解析配置:app:debugRuntimeClasspath"的所有文件.>无法转换 timezago-1.1.8.aar (com.chootdev:timezago:1.1.8) 以匹配属性 {artifactType=android-assets, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.>JetifyTransform 执行失败:C:\Users\JRAR\.gradle\caches\modules-2\files-2.1\com.chootdev\timezago\1.1.8\a988a24719cbe07115df73a045aa251630cdb10\timezago-1.1.1.>使用Jetifier.8ifier. 无法转换'C:\Users\JRAR\.gradle\caches\modules-2\files-2.1\com.chootdev\timezago\1.1.8\a988a24719cbe07115df73a045aa251630cdb10\timezago-1.1.8.原因:ZipException,消息:重复条目:AndroidManifest.
解决方案
问题在于 allowbackup 和 appComponentFactory.我在这个
I'm using a project downloaded from codecanyon.net, the project fails Gradle build with an error message. I tried reviewing other questions with a similar issue but none worked for me. Please anybody can help me fix this issue
Below is the manifest file
<?
and this is the excception detailed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform timezago-1.1.8.aar (com.chootdev:timezago:1.1.8) to match attributes {artifactType=android-assets, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\JRAR\.gradle\caches\modules-2\files-2.1\com.chootdev\timezago\1.1.8\a988a24719cbe07115df73a045aa251630cdb10\timezago-1.1.8.aar.
> Failed to transform 'C:\Users\JRAR\.gradle\caches\modules-2\files-2.1\com.chootdev\timezago\1.1.8\a988a24719cbe07115df73a045aa251630cdb10\timezago-1.1.8.aar' using Jetifier. Reason: ZipException, message: duplicate entry: AndroidManifest.
解决方案
The issue was with allowbackup and appComponentFactory. I found lead to my solution in this question, if logs and build is not providing enough details about the issue, do check merged manifest it show errors with suggestions.
Open application manifest (AndroidManifest.Merged Manifest (in bottom) see image below.
这篇关于原因:重复条目:AndroidManifest.