最近在打包项目的时候先是遇到了这个问题

然后我把compileSdk 32 改成 compileSdk 31
targetSdk 32 改成 targetSdk 31
h后报错:
FAILURE: Build completed with 8 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
5: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.support: appcompat-v7:25.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://repo.maven.apache.org/maven2/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
- https://jcenter.bintray.com/com/android/support/ appcompat-v7/25.1.0/ appcompat-v7-25.1.0.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.4-rc-2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 12s
18 actionable tasks: 9 executed, 9 up-to-date
b不知道该怎么解决
新建其他项目也可以跑到手机上
出现这个问题可能和我使用了百度地图sdk有关
你自己看一下log,应该也可以解决呀。
我随便找了一个