Android Studio 问题记(一)

简介: 1,Error Loading Project: Cannot load module walk 解决:close project , import project 2,unregistered vcs root detected the directory  解决:add roo...

1,Error Loading Project: Cannot load module walk

解决:close project , import project


2,unregistered vcs root detected the directory 

解决:add root


3,Error running: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.

解决:


4,Execution failed for task ':compileDebugAidl'. java.lang.IllegalStateException: aidl is missing

  统一所有的module的build tools版本与compile idk版本


5,  Error:(36, 0) Gradle DSL method not found: 'testCompile()' 

 直接注释掉,不影响


6,  Error:A problem was found with the configuration of task ':app:packageDebug'.

> File '/Users/hujason/AndroidStudioProjects/MyApplication/app/build/intermediates/res/resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.

把下面代码注释掉即可

shrinkResources true

    buildTypes {
        release {
            minifyEnabled true
//            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled true
//            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }



7,  Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
> java.io.IOException: Please correct the above warnings first.


Information:Gradle tasks [:app:assembleDebug]
Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.ConcurrentCircularArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.ConcurrentSequencedCircularArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.MpscLinkedQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpscArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.SpscUnboundedArrayQueue: can't find referenced class sun.misc.Unsafe
Warning:rx.internal.util.unsafe.UnsafeAccess: can't find referenced class sun.misc.Unsafe
Warning:there were 44 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
> java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
Information:Total time: 3.77 secs
Information:1 error
Information:14 warnings
Information:See complete output in console


在proguard-rules.pro中添加

-dontwarn rx.internal.util.unsafe.*


8、Error:Unable to load class 'org.gradle.logging.StyledTextOutput$Style'.

    导入开源中国安卓客户端

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.3.0'
    }
}
 
升级 dexcount-gradle-plugin 版本到最新 0.7.2

相关文章
|
1月前
|
缓存 程序员 定位技术
Android Studio 插件,那些被大厂优化的程序员们
Android Studio 插件,那些被大厂优化的程序员们
|
6天前
|
XML 存储 数据库
如何使用Android Studio创建一个基本的音乐播放器应用
如何使用Android Studio创建一个基本的音乐播放器应用
19 0
|
17天前
|
开发工具 Android开发 开发者
Android Studio中两个让初学者崩溃菜单
Android Studio中两个让初学者崩溃菜单
17 0
|
1天前
|
XML Java 开发工具
Android Studio开发Android TV
【6月更文挑战第19天】
|
3天前
|
Android开发
Android studio 出现Plugin [id: ‘com.android.application‘, version: ‘8.1.0‘, apply: false] 问题解决办法
Android studio 出现Plugin [id: ‘com.android.application‘, version: ‘8.1.0‘, apply: false] 问题解决办法
35 1
|
5天前
|
数据库 Android开发 数据安全/隐私保护
在 Android Studio 中结合使用 SQLite 数据库实现简单的注册和登录功能
在 Android Studio 中结合使用 SQLite 数据库实现简单的注册和登录功能
36 2
|
7天前
|
Java API 开发工具
【Android】安Android Studio环境搭建注意点
【Android】安Android Studio环境搭建注意点
24 1
|
11天前
|
开发工具 Android开发
android studio build异常
android studio build异常
18 3
|
13天前
|
Android开发 Windows
android studio开发时提示 TLS 握手错误解决办法
在Windows环境下遇到TLS协议版本不支持的错误,Gradle构建失败。解决方案是在build.gradle.kts中设置系统属性`https.protocols`为`TLSv1.2`,而非遵循误导信息设置为TLSv1.1。
|
19小时前
|
Android开发
如何 将Android Studio升级至最新版(4.0)
如何 将Android Studio升级至最新版(4.0)
4 0