Android Studio 問題記(一)
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.
解決:
統一所有的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 { minifyEnabledtrue // 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