从 Eclipse 导入后清单合并失败
Manifest Merger failed after importing from Eclipse
我已经将一个项目从 Eclipse 导入到 Android Studio。当我构建项目时,它显示 "Manifest merger failed with multiple errors, see logs" 错误。
我已经尝试更新应用程序模块中的 sdk 版本(最小和目标),但似乎有更多冲突。日志对我一点帮助都没有...
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':zafraApp:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.run(DefaultTaskGraphExecuter.java:248)
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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access0(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:524)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:143)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.GeneratedMethodAccessor600.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:46)
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.run(ExecuteActionsTaskExecuter.java:121)
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:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
我的主要代码没有问题,可能在 gradle 文件或清单文件中?
ECLIPSE ANDROID PROJECT IMPORT SUMMARY
======================================
Manifest Merging:
-----------------
Your project uses libraries that provide manifests, and your Eclipse
project did not explicitly turn on manifest merging. In Android Gradle
projects, manifests are always merged (meaning that contents from your
libraries' manifests will be merged into the app manifest. If you had
manually copied contents from library manifests into your app manifest
you may need to remove these for the app to build correctly.
Ignored Files:
--------------
The following files were *not* copied into the new Gradle project; you
should evaluate whether these are still needed in your project and if
so manually move them:
From CaptureActivity:
* ant.properties
* build.xml
From ZafraApp:
* app_icono-web.png
* ic_launcher-web.png
* proguard-project.txt
From library:
* pom.xml
Replaced Jars with Dependencies:
--------------------------------
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:
android-support-v4.jar => com.android.support:support-v4:18.0.0
android-support-v7-appcompat.jar => com.android.support:appcompat-v7:18.0.0
Replaced Libraries with Dependencies:
-------------------------------------
The importer recognized the following library projects as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the source files in your project were of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the library replacement in the import wizard and try
again:
android-support-v7-appcompat => [com.android.support:appcompat-v7:18.0.0]
Moved Files:
------------
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:
In CaptureActivity:
* AndroidManifest.xml => captureActivity\src\main\AndroidManifest.xml
* assets\ => captureActivity\src\main\assets\
* libs\core.jar => captureActivity\libs\core.jar
* proguard.cfg => captureActivity\proguard.cfg
* res\ => captureActivity\src\main\res\
* src\ => captureActivity\src\main\java\
In library:
* AndroidManifest.xml => library\src\main\AndroidManifest.xml
* assets\ => library\src\main\assets
* res\ => library\src\main\res\
* src\ => library\src\main\java\
In ZafraApp:
* AndroidManifest.xml => zafraApp\src\main\AndroidManifest.xml
* assets\ => zafraApp\src\main\assets
* res\ => zafraApp\src\main\res\
* src\ => zafraApp\src\main\java\
* galeria_monumentos_aljimez_foto3.JPG => galeria_monumentos_aljimez_foto3.jpg
* galeria_monumentos_casagrande_foto2.JPG => galeria_monumentos_casagrande_foto2.jpg
* galeria_monumentos_casagrande_foto3.JPG => galeria_monumentos_casagrande_foto3.jpg
* galeria_monumentos_casagrande_foto4.JPG => galeria_monumentos_casagrande_foto4.jpg
* galeria_monumentos_clara_foto3.JPG => galeria_monumentos_clara_foto3.jpg
* galeria_monumentos_clara_foto4.JPG => galeria_monumentos_clara_foto4.jpg
* galeria_monumentos_santiago_foto2.JPG => galeria_monumentos_santiago_foto2.jpg
Next Steps:
-----------
You can now build the project. The Gradle project needs network
connectivity to download dependencies.
Bugs:
-----
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.
(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)
zafraApp 它是主要模块,另外两个(库和捕获活动)是支持库。那是对的吗?
新更新:
点击"Merged Manifest"可以看到合并的错误,就在botton
点击它们我可以解决合并问题,但我与 appcompat 库有某种冲突。
问题似乎出在这里:
我检查了清单,看起来也很好,我的问题似乎在 gradle 文件中,我一直在阅读不同 sdk 版本可能出现的问题,我的是:
主模块:zafraapp
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "ayto.appzafra"
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':library')
compile project(':captureActivity')
compile 'com.android.support:appcompat-v7:18.0.0'
}
第二(图书馆)
apply plugin: 'com.android.library'
android {
compileSdkVersion 'Google Inc.:Google APIs:17'
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 4
targetSdkVersion 4
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
}
最后一个也是图书馆:
apply plugin: 'com.android.library'
android {
compileSdkVersion 'Google Inc.:Google APIs:17'
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 7
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
compile files('libs/core.jar')
}
manifest里面的sdk版本也完全不一样,我现在很迷茫哈哈
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19"
/>
我必须针对相同的版本和 minsdk 吗?
为库和应用程序更改 minSdkVersion
,并且对所有内容都相同。在所有 manifest
个文件中设置 android:allowBackup="false"
。
解决方案是用保持相同版本级别的较新版本更新库。
我已经将一个项目从 Eclipse 导入到 Android Studio。当我构建项目时,它显示 "Manifest merger failed with multiple errors, see logs" 错误。
我已经尝试更新应用程序模块中的 sdk 版本(最小和目标),但似乎有更多冲突。日志对我一点帮助都没有...
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':zafraApp:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.run(DefaultTaskGraphExecuter.java:248)
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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access0(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:524)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:143)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.GeneratedMethodAccessor600.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:46)
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.run(ExecuteActionsTaskExecuter.java:121)
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:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
我的主要代码没有问题,可能在 gradle 文件或清单文件中?
ECLIPSE ANDROID PROJECT IMPORT SUMMARY
======================================
Manifest Merging:
-----------------
Your project uses libraries that provide manifests, and your Eclipse
project did not explicitly turn on manifest merging. In Android Gradle
projects, manifests are always merged (meaning that contents from your
libraries' manifests will be merged into the app manifest. If you had
manually copied contents from library manifests into your app manifest
you may need to remove these for the app to build correctly.
Ignored Files:
--------------
The following files were *not* copied into the new Gradle project; you
should evaluate whether these are still needed in your project and if
so manually move them:
From CaptureActivity:
* ant.properties
* build.xml
From ZafraApp:
* app_icono-web.png
* ic_launcher-web.png
* proguard-project.txt
From library:
* pom.xml
Replaced Jars with Dependencies:
--------------------------------
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:
android-support-v4.jar => com.android.support:support-v4:18.0.0
android-support-v7-appcompat.jar => com.android.support:appcompat-v7:18.0.0
Replaced Libraries with Dependencies:
-------------------------------------
The importer recognized the following library projects as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the source files in your project were of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the library replacement in the import wizard and try
again:
android-support-v7-appcompat => [com.android.support:appcompat-v7:18.0.0]
Moved Files:
------------
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:
In CaptureActivity:
* AndroidManifest.xml => captureActivity\src\main\AndroidManifest.xml
* assets\ => captureActivity\src\main\assets\
* libs\core.jar => captureActivity\libs\core.jar
* proguard.cfg => captureActivity\proguard.cfg
* res\ => captureActivity\src\main\res\
* src\ => captureActivity\src\main\java\
In library:
* AndroidManifest.xml => library\src\main\AndroidManifest.xml
* assets\ => library\src\main\assets
* res\ => library\src\main\res\
* src\ => library\src\main\java\
In ZafraApp:
* AndroidManifest.xml => zafraApp\src\main\AndroidManifest.xml
* assets\ => zafraApp\src\main\assets
* res\ => zafraApp\src\main\res\
* src\ => zafraApp\src\main\java\
* galeria_monumentos_aljimez_foto3.JPG => galeria_monumentos_aljimez_foto3.jpg
* galeria_monumentos_casagrande_foto2.JPG => galeria_monumentos_casagrande_foto2.jpg
* galeria_monumentos_casagrande_foto3.JPG => galeria_monumentos_casagrande_foto3.jpg
* galeria_monumentos_casagrande_foto4.JPG => galeria_monumentos_casagrande_foto4.jpg
* galeria_monumentos_clara_foto3.JPG => galeria_monumentos_clara_foto3.jpg
* galeria_monumentos_clara_foto4.JPG => galeria_monumentos_clara_foto4.jpg
* galeria_monumentos_santiago_foto2.JPG => galeria_monumentos_santiago_foto2.jpg
Next Steps:
-----------
You can now build the project. The Gradle project needs network
connectivity to download dependencies.
Bugs:
-----
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.
(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)
zafraApp 它是主要模块,另外两个(库和捕获活动)是支持库。那是对的吗?
新更新:
点击"Merged Manifest"可以看到合并的错误,就在botton
点击它们我可以解决合并问题,但我与 appcompat 库有某种冲突。
问题似乎出在这里:
我检查了清单,看起来也很好,我的问题似乎在 gradle 文件中,我一直在阅读不同 sdk 版本可能出现的问题,我的是:
主模块:zafraapp
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "ayto.appzafra"
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':library')
compile project(':captureActivity')
compile 'com.android.support:appcompat-v7:18.0.0'
}
第二(图书馆)
apply plugin: 'com.android.library'
android {
compileSdkVersion 'Google Inc.:Google APIs:17'
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 4
targetSdkVersion 4
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
}
最后一个也是图书馆:
apply plugin: 'com.android.library'
android {
compileSdkVersion 'Google Inc.:Google APIs:17'
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 7
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
compile files('libs/core.jar')
}
manifest里面的sdk版本也完全不一样,我现在很迷茫哈哈
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19"
/>
我必须针对相同的版本和 minsdk 吗?
为库和应用程序更改 minSdkVersion
,并且对所有内容都相同。在所有 manifest
个文件中设置 android:allowBackup="false"
。
解决方案是用保持相同版本级别的较新版本更新库。