Android Studio问题集锦
installation failed with message invalid file
1.点击工具栏上的Build中的Clean Project
2.再点击工具栏上的Build中的Rebulid Projec
DELETE_FAILED_INTERNAL_ERROR Error while Installing APK
Android Studio > Settings> Build, Execution, Deployment > Instant Run > Uncheck : Enable Instant Run
Error running app: Default Activity Not Found
Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
网络权限的问题
<uses-permission android:name="android.permission.INTERNET" />
xxx is not an enclosing class
实例化A类的内部类,需要A类的实例
Field can be converted to a local varible
该变量可以用局部变量代替
Gradle sync failed: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. Consult IDE log for more details (Help | Show Log)
1.local.properties中sdk路径
2.sdk版本
No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)
版本不一致,图中为app/build.gradle的内容划线处版本要一致
Debug出现:
Could not connect to remote process. Aborting debug session.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
</application>
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
</application>
Error:error: resource android:attr/preserveIconSpacing is private.
将android:preserveIconSpacing改为preserveIconSpacing
资料来源:
Android studio 2.3小米系列手机调试Installation failed with message Failed to establish session
在开发者选项里 关闭MIUI优化!
Failed to load AppCompat ActionBar with unknown error.
在Theme.AppCompat.Light.DarkActionBar前面加上Base.
Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
https://blog.csdn.net/qq_21397217/article/details/65630730
修改了布局运行后没有效果.
后来发现是因为我那个布局文件有两个不同分辨率的版本,我改了那个没有被我那台平板识别的分辨率版本布局文件
android java.lang.IllegalStateException: System services not available to Activities before onCreate
使用new关键字实例化Activity类
java.lang.ClassCastException
类型转换错误,尝试将子类强制转换成父类,导致异常
all com.android.support libraries must use the exact same version specification
虑强制让所有模块都用相同的(25.2.0)支持库版本:
在app中的build.gradle中添加:
- configurations.all {
- resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- def requested = details.requested
- if (requested.group == 'com.android.support') {
- if (!requested.name.startsWith("multidex")) {
- details.useVersion '25.2.0'
- }
- }
- }
- }
Error:Error converting bytecode to dex
一、包重复
二、build本身的问题,可能是build缓存的问题,只需要clean下工程,然后在rebuild
Error:Connection refused: connect
在gradle.properties中添加了代理,删掉即可
Android Studio 3.1控件无法显示在预览界面
更换APPThem
jumpDrawablesToCurrentState(ViewGroup.java:5165)
将*inflater.inflate(R.layout.fragment_collect,**container**)*更改为*inflater.inflate(R.layout.fragment_collect,**null**)*
上一篇: awk3.0 — awk变量
下一篇: 安装jenkins后卡在访问页面中
推荐阅读
-
Android安装应用 INSTALL_FAILED_DEXOPT 问题及解决办法
-
Flutter下Android Studio配置gradle的方法
-
Android studio开发小型对话机器人app(实例代码)
-
Android Studio finish()方法的使用与解决app点击“返回”(直接退出)
-
解决Android 10/Android Q手机在后台无法正常定位问题
-
Android实现关机后数据不会丢失问题
-
Android Studio屏幕方向以及UI界面状态的保存代码详解
-
Android studio 连接手机调试操作步骤
-
详解android studio游戏摇杆开发教程,仿王者荣耀摇杆
-
Android studio设计简易计算器