今天打开老项目出现毛病了,其实这个问题我遇到过很多次了,都没有仔细的去解决,或者总结经验,导致每次度需要百度
Error:D:\dev\QSSQ666\app\src\main\AndroidManifest.xml:28:13-35 Error:
Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:design:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-core-utils:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:design:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-core-utils:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
* 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
BUILD FAILED in 13s
提示错误行在28行实际上呢却不在28行。
image.png
解决方法估计有2种吧,一种是全局替换
第一种方法:
找出所有buildTool support等25.+或者之类的改成26.
第二种就是根据提示操作
<meta-data android:name="android.support.VERSION" tools:replace="android:value" />
第三种就是全局gradle拦截
出现错误
Error:注: D:\dev\huluboshi_new\isoprogressbar\src\main\java\space\qssq\progressbar\ProgressWheel.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: D:\dev\huluboshi_new\multi-image-selector1\src\main\java\me\nereo\multi_image_selector\MultiImageSelectorFragment.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
line 1:15 token recognition error at: '@{'
line 1:26 token recognition error at: '}'
line 1:15 token recognition error at: '@{'
line 1:33 token recognition error at: '}'
line 1:11 token recognition error at: '`'
D:\dev\xxxx\app\src\main\AndroidManifest.xml:472:9-92 Error:
tools:replace specified at line:472 for attribute android:value, but no new value specified
D:\dev\xxxx\app\src\main\AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
* 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
BUILD FAILED in 33s
修改为
<meta-data android:name="android.support.VERSION" tools:replace="android:value" android:value="26.0.1" />
哈市有错误
app:compileDebugJavaWithJavac
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:19: 错误: 无法访问ActivityCompatApi23
public abstract class SuperActivity extends AppCompatActivity {
^
找不到android.support.v4.app.ActivityCompatApi23的类文件
line 1:15 token recognition error at: '@{'
line 1:26 token recognition error at: '}'
line 1:15 token recognition error at: '@{'
line 1:33 token recognition error at: '}'
line 1:11 token recognition error at: '`'
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:20: 错误: 找不到符号
protected final String TAG = this.getClass().getSimpleName();
^
符号: 变量 this
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:22: 错误: 方法不会覆盖或实现超类型的方法
@Override
^
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:29: 错误: 不是封闭类: SuperActivity
PhoneUtils.setHideVirtualKey(SuperActivity.this);
^
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:26: 错误: 找不到符号
this.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
^
符号: 变量 this
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:32: 错误: 找不到符号
super.onCreate(savedInstanceState);
^
符号: 变量 super
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:36: 错误: 找不到符号
super.onResume();
^
符号: 变量 super
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:37: 错误: 找不到符号
PhoneUtils.hideSystemUI(this);
^
符号: 变量 this
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:38: 错误: 找不到符号
MobclickAgent.onResume(this);
^
符号: 变量 this
位置: 类 SuperActivity
D:\dev\qssq666_new\app\src\main\java\com\qssq666\base\SuperActivity.java:42: 错误: 找不到符号
super.onPause();
^
符号: 变量 super
位置: 类 S
解决方法
大概是compileSdkVersion buildToolsVersion
这个版本号修改为一致
然后dependencies节点中搜索是否有25的,可以通过搜索gradle批量替换
就ok。
image.png