Android Studio常见问题汇编
16lz
2021-01-23
编译问题:
1、Ubantu系统,Android Studio编译,出现错误。
android { compileSdkVersion 22 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 8 targetSdkVersion 21 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }}
提示错误信息:
com.android.ide.common.process.ProcessException: Failed to execute aapt
解决方法:安装32位C++编译库
$ sudo apt-get install lib32stdc++6 lib32z1
2、Android Studio gradle3.3.2以下,google()仓库不识别?
将其替换为:
maven { url 'https://maven.google.com/'}
3、手机指令集查看
$ adb shell getprop ro.product.cpu.abi
通过adb 命令查看手机指令集文件
4、更新项目或者git拉去代码时。提示使用git报错:Failed to connect to 127.0.0.1 port 8888: 拒绝连接。
这是代理设置问题。
首先去掉设置中的代理项
Setting--》System Setting--》HTTP Proxy,设置No Proxy
第二步,关掉代理软件,防止拦截http或者https请求
第三步,检查系统设置
查看代理:
$ env|grep -i proxy
https_proxy=127.0.0.1:8888http_proxy=127.0.0.1:8888socks_proxy=ftp_proxy=
关闭代理设置
export http_proxy=''
export https_proxy=''
第二章 ADB相关错误
2.1 ADB命令安装APK的时候出现问题
zhouronghuadeiMac:etc zhouronghua$ adb install -r /Users/zhouronghua/DEV/projects/accmobile/app/build/outputs/apk/zsxtzk/debug/app-zsxtzk-debug.apk error: more than one device/emulatorerror: more than one device/emulatorPerforming Streamed Install
因为有多个设备或者模拟器,安装的时候,有的设备安装出问题导致。
zhouronghuadeiMac:etc zhouronghua$ adb devicesList of devices attachedCLB7N19212002834deviceTA00405N7Tdevice
通过adb devices查询设备。
更多相关文章
- Android消息提示之Toast
- Android硬件设备检测
- 【实用工具】adb检测android设备
- android 使用linux命令截屏
- android读取usb设备数据
- android执行Linux命令
- 【android-tips】android程序执行adb shell命令(实例源码)
- 提示:Not targeting the latest versions of Android; compatibil
- Android 情景模式提示音默认修改