1. 程式人生 > >android---實際開發中遇到的問題總結

android---實際開發中遇到的問題總結

在實際開發專案的時候經常會遇到一些問題,在這裡進行總結,希望讀者在遇到相同問題的時候能夠儘快解決自己的問題,或者為讀者提供一種解決方案


問題1:

        

隨著專案的逐漸增大,不可避免的要設定mutidex 但是這會使我們的專案編譯變慢,並且有的時候會發生很多異常,導致編譯不成功 (1) 對於有很多依賴的專案,編譯可能因為下面的錯誤中斷 Error:Execution failed for task ':app:dexDebug'. ...
Error Code: 3 Output: UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:326) 具體解決方式:在app的build.gradle中設定下邊兩句可以解決 dexOptions { incremental true javaMaxHeapSize "4g" }

問題2: INSTALL_FAILED_NO_MATCHING_ 解決方式:是由於使用了native libraries 。該native libraries 不支援當前的cpu的體系結構。 INSTALL_FAILED_NO_MATCHING_ABIS is when you are trying to install an app that has native libraries and it doesn't have a native library for your cpu architecture. For example if you compiled an app for armv7 and are trying to install it on an emulator that uses the Intel architecture instead it will not work.現在安卓模擬器的CPU/ABI一般有三種類型,INTEL X86,ARM,MIPS,