01椒惨、
解決方案:
Gradle的一個Bug缤至,解決辦法是,刪除項目根目錄的.gradle文件夾康谆,然后Clean ,Rebulid领斥。
02、git 提交代碼無法提交問題
Unable to create 'D:/work/******/.git/index.lock': File exists.
If no other git process is currently running, this probably means a git process
crashed in this repository earlier. Make sure no other git process is running
and remove the file manually to continue.
解決方案:找到相應(yīng)位置的 index.lock 刪除即可
03秉宿、
java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView
cannot be cast to android.widget.EditText
類型轉(zhuǎn)換異常戒突,在這里是TextView轉(zhuǎn)換成EditText,粗心導(dǎo)致崩潰描睦。
解決方案:類型替換就好了
04膊存、see the compiler error output for details
Error:Execution failed for task ':xxxx:compileStDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
這個花了比較多的時間來排查問題,在網(wǎng)絡(luò)上也找了幾種方式嘗試了一下都沒有解決,在這里總結(jié)一下自己解決的方式隔崎。
錯誤原因:
@Autowired(name = ParamKeys.ACTIVITY_XXX)
private XxxBean mXxxBean;
通過ARouter 接收參數(shù)時今艺,多了一個 private 屬性,從而出現(xiàn)這種錯誤爵卒。
問題解決:
去掉 private 屬性虚缎,編譯正常。
注意:這類問題出現(xiàn)的原因钓株,主要是自己的編碼的問題实牡,應(yīng)該仔細(xì)檢查自己出現(xiàn)問題的代碼,看是否有比較特殊的轴合。另外studio 右下角有一個 Gradle Console 创坞,在這里可以看看具體哪里出現(xiàn)問題,會給你具體位置受葛。如下:
錯誤: ARouter::Compiler An exception is encountered, [The inject fields CAN NOT BE
'private'!!! please check field [mXxxxBean] in class [xxx.xxxx.xxxxxActivity]]
05题涨、
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
從一個Activity中要通過intent調(diào)出另一個Activity的話,需要使用 FLAG_ACTIVITY_NEW_TASK
注:可能是啟動時Activtiy與Context的問題
06总滩、
Execution failed for task ':***:processSt3DebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:53:9-36
is also present at [***:pushlibrary:unspecified] AndroidManifest.xml:31:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:51:5-1426:19 to override.
由上面提示可以看出是 AndroidManifest 文件中的 application 節(jié)點里面的屬性配置錯誤纲堵。
原代碼:
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">
解決:將相應(yīng)屬性去掉或者按照提示配置就好了。
07闰渔、Jar 包重復(fù)引用
Multiple dex files define Lcom/baidu/android/pushservice/e/z;