Android-日常問題匯總

1.小米手機顯示安卓失敗之類

開發者選項允許usb安卓

2.java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

https://bbs.csdn.net/topics/392342785?page=1

http://bbs.bugcode.cn/t/8920

3.This Gradle plugin requires Studio 3.0 minimum

https://blog.csdn.net/shenggaofei/article/details/78165940

4.Could not find com.android.tools.build:gradle:3.0.0.

https://blog.csdn.net/zhouxianling233/article/details/78359217

5.Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.

https://blog.csdn.net/p576518762/article/details/78356137

6.微信登錄 支付分享

https://www.cnblogs.com/yishaochu/p/7531638.html

微信登錄.分享

https://www.cnblogs.com/shen-hua/p/6343736.html

7.Error:Failed to resolve: com.android.support:appcompat-v7:27.+

https://blog.csdn.net/qq_31344665/article/details/79283979

8.解決Android Studio Gradle Build Running慢的問題

https://www.cnblogs.com/oukunqing/p/5864671.html?utm_source=itdadao&utm_medium=referral

https://blog.csdn.net/dabaoonline/article/details/50550423

https://blog.csdn.net/a549742320/article/details/52525257

9.Error:The module 'app' is an Android project without build variants, and cannot be built.

Please fix the module's configuration in the build.gradle file and sync the project again.

https://stackoverflow.com/questions/49834961/the-module-app-is-an-android-project-without-build-variants

項目最后用 gradle 文件點擊的運行

10.unable to access android sdk add-on list的解決方法

https://blog.csdn.net/u014471160/article/details/78505653

The specified Android SDK Build Tools version (27.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.

Android SDK Build Tools 27.0.3 will be used.

11.Android studio 提示 module not specified

Build項目還是不行,那么就重啟了as( File->Invalidate Caches/Restart)

12Android Studio修改字體大小

https://www.cnblogs.com/diyishijian/p/6824328.html

https://blog.csdn.net/niaonao/article/details/51378596

13.> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

https://blog.csdn.net/sky_castle/article/details/53606929

buid 配置 java

14.Error:Could not find com.android.tools.build:gradle:3.1.2.

build 配置 少了 goole

15.android-apt plugin is incompatible with the Android Gradle plugin. ?Please use 'annotationProcessor' configuration instead.

https://blog.csdn.net/sxk874890728/article/details/78367726

16.如何更改android Studio logcat字體大小?

https://blog.csdn.net/ykttt1/article/details/46291029

17.Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

https://blog.csdn.net/fullstackdeveloper/article/details/52701707

18.The version of Gradle you are using (3.3) does not support the forTasks() method on BuildActionExecuter. Support for this is available in Gradle 3.5 and all later?

https://blog.csdn.net/baidu_38291700/article/details/80263294

19. org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD

轉?https://blog.csdn.net/yuanxw44/article/details/80061381

google()

20.Annotation processors must be explicitly declared now. ?The following dependencies on the compile cl (7.0.1)

?https://blog.csdn.net/keep_holding_on/article/details/76188657

javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }

21.design editor is unavailable until a successful build

轉?https://blog.csdn.net/zhs966877/article/details/78466884?locationNum=6&fps=1

Rebuild Project

22.studio 中 新文件直接提交svn項目中

轉?https://blog.csdn.net/acmen99/article/details/76825426

23.listview 數據回調監聽

https://blog.csdn.net/belyxiong/article/details/46819671

24 動畫實現的overridePendingTransition 注意點

?https://blog.csdn.net/u010015108/article/details/49616003

25 Call requires API level 24 (current min is 15): java.util.stream.Stream#map less... (Ctrl+F1)

This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest). ?If you really want to use this API and don't need to support older devices just set the minSdkVersion in your build.gradle or AndroidManifest.xml files. ?If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi (忽略)

25.決“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”問題

轉?https://www.cnblogs.com/yeahgis/p/4660873.html

26.Failed to find byte code for java/util/function/Predicate

轉?https://blog.csdn.net/qq_31433709/article/details/80969761

27,oppo 極光推送收不到

?https://community.jiguang.cn/t/topic/29762

28無法訪問https://developer.android.com相應的網站

轉?https://blog.csdn.net/saywhat_sayhello/article/details/78989077

29.Could not find method google() for arguments [] on repository container of type

gradle 的版本配置太低

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

classpath 'com.android.tools.build:gradle:3.1.4'

30.import io.reactivex.android.schedulers.AndroidSchedulers 類找不到

io.reactivex.rxjava2:rxandroid:2.0.2版本 改成 2.0.1 然后build

31.dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1 was ever shown via Activity#showDialog

app 中 build.grale 配置 multiDexEnabled true 配置

加 apllication中 代碼

@Override

protected void attachBaseContext(Context base) {

super.attachBaseContext(base);

MultiDex.install(base);

}

32 極光推送 web推送 可以,api推送不可以

ok了 ?web 自定義推送 可以成功。 api 推送不成功。 要debug 模式true下

33. studio 占用 c盤太大的問題 可選的

C:\Users\Administrator\AppData\Local\Temp ?刪除 ?處理( 可能導致studio 所有項目的結構發生變化)

34.提示安裝包已損壞

1.點擊應用里。。所有用戶卸載。

2.我的AS是3.2版本的,gradle版本是4.1的,前面自己寫了demo,簽名打包之后用應用寶安裝,提示包已損壞,請重新下載。。。使用adb安裝命令是可以正常安裝,本地運行也是可以正常運行,但是用應用寶安裝就出問題,嘗試了各種網上說的方法,還是沒有效果,最后看到一個帖子,里面提到“把build tools 版本改成27.0.2就行了”,我就試了一下,確實可行,這里只要修改在27以上就OK了,我的是27.0.3,在這里記錄一下,下次碰到這個問題,就不怕忘記怎么處理了。

https://blog.csdn.net/chenhan0719/article/details/79738821?

35.GPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not found.","sources":[{"file":"C:\\Users\\Administrator\\.gradle\\caches\\transforms-1\\files-1.1\\support-compat-28.0.0.aar\\6010d9958d2330d28494eb2d1ce90f89\\res\\values\\values.xml","position":{"startLine":132,"startColumn":4,"startOffset":7725,"endColumn":69,"endOffset":7790}}],"original":"","tool":"AAPT"}

rxandroidVersion = "2.0.1" ? 2.0.2 改成2.0.1

還有 support ?配置沒有不對

36.這個問題是由于操作 33導致。studio project structure 目錄結構發生變化

因為c盤空間不夠啊 。按33操作導致。studio 有關插件失效 。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 230,622評論 6 544
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,716評論 3 429
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事?!?“怎么了?”我有些...
    開封第一講書人閱讀 178,746評論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,991評論 1 318
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,706評論 6 413
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 56,036評論 1 329
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 44,029評論 3 450
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 43,203評論 0 290
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,725評論 1 336
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,451評論 3 361
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,677評論 1 374
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 39,161評論 5 365
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,857評論 3 351
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,266評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,606評論 1 295
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,407評論 3 400
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,643評論 2 380

推薦閱讀更多精彩內容