欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Android Studio问题集锦

程序员文章站 2022-06-01 14:14:42
...

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

 

Android Studio问题集锦

Android Studio问题集锦

 

 

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的内容划线处版本要一致

Android Studio问题集锦

 

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

资料来源:

https://*.com/questions/45865366/cardslib-error-resource-androidattr-foregroundinsidepadding-is-private-while-ta

 

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中添加:

 

  1. configurations.all {  
  2.     resolutionStrategy.eachDependency { DependencyResolveDetails details ->  
  3.         def requested = details.requested  
  4.         if (requested.group == 'com.android.support') {  
  5.             if (!requested.name.startsWith("multidex")) {  
  6.                 details.useVersion '25.2.0'  
  7.             }  
  8.         }  
  9.     }  
  10. }  

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**)*

 

 

 

 

 

 

相关标签: android