Android Studio 常见错误(二)

AS使用过程中遇到的问题总是多种多样的,每遇到一个,就意味着对Studio的了解加深了一步。

/******************************* 我是正文的分割线 ********************************/

因项目需要接入第三方SDK,于是引入一个Library,于是就抛出了这么一个异常:

遇到这样的提示,首先,点击最后一行的“see complete output in console”来查看详细信息:

看这里的提示,说是在AndroidManifast文件中 的value  和theme和Library 给冲突掉了,

解决办法有两种,第一种,是吧style的名字和icon的名字都重命名一下,

第二种:在<application>中,加一句话:

tools:replace="android:icon, android:theme, android:label"

意思为,替换icon theme label ,使用当前主Module的icon theme  label

整体如下:

  <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/APP_Name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/CenterTheme"
        tools:replace="android:icon, android:theme, android:label">

然后rebuild一下:构建成功。

/***********************************   2018.9.20 补充     **********************************************/

还是Android studio的问题:不知道是什么原因,AS像打了鸡血一样不停的indexing,导致我连看一下效果都不行。

这个不听话的乖宝宝搞得人很头大。但是我相信遇到这样问题的人不止我一个,于是,百度了一下,就能看到解决办法:

File->Invalidate Caches/Restart  ->Invalidate and start       等AS再次启动起来,它已经是个乖宝宝了,实测有效。

猜你喜欢

转载自blog.csdn.net/amaoagou112/article/details/80773898