我有我的項目中下面的模塊,我不能讓搖籃合併了Android表現正常:搖籃合併封裝/子模塊的Android清單到主模塊的清單
myproject_alpha
myproject_beta
myproject_lib
myproject_release
的* _lib模塊該項目的主要模塊包含所有源代碼。其他3個模塊是「包裝模塊」,對內容提供者的「權限」參數進行輕微修改,更改* _lib模塊清單中指定的活動意向過濾器中的「數據」字段,並允許其他一些不存在的活動myproject_release模塊。
目前,我已經在alpha(或beta或release)與lib之間對Android錯誤進行了合併。例如,lib和阿爾法之間我看到以下的gradle 2個錯誤:
Trying to merge incompatible /manifest/application/provider[@name=com.myproject.contentprovider.MyProvider] element:
<provider
-- @android:authorities="com.myproject.alpha.provider"
<provider
++ @android:authorities="com.myproject.lib.provider"
:myproject_alpha:processDebugManifest FAILED
Trying to merge incompatible /manifest/application/activity[@name=com.myproject.activity.LoginActivity] element:
<activity
@android:name="com.myproject.activity.LoginActivity"
@android:name="android.intent.action.MAIN">
@android:name="android.intent.category.LAUNCHER">
<intent-filter>
@android:name="android.intent.action.VIEW">
@android:name="android.intent.category.BROWSABLE">
@android:name="android.intent.category.DEFAULT">
<data
-- @android:host="myhost.test.com"
<activity
@android:name="com.myproject.LoginActivity"
@android:name="android.intent.action.MAIN">
@android:name="android.intent.category.LAUNCHER">
<intent-filter>
@android:name="android.intent.action.VIEW">
@android:name="android.intent.category.BROWSABLE">
@android:name="android.intent.category.DEFAULT">
<data
++ @android:host="myhost.com"
:myproject_alpha:processDebugManifest FAILED
唯一相似的問題,我發現
Gradle: How to merge Android manifest files for different buildTypes which need the same Activity, but with different intent-filters。然而,它並不真正符合我的問題,因爲在我的情況下,「lib」和「alpha」是相互依賴的模塊,而不是不同的構建。我會欣賞一些反饋。
感謝您的鏈接,它很有用。我們繼承了來自外部團隊的代碼,因此不確定他們是否有代碼按照原樣構建。現在我編輯所有清單以使用相同的簽名,並且在未來的版本中,我將重構代碼庫以更好地使用Gradle。 – cavega