I am experiencing a strange bug with Android Studio with new projects since yesterday (haven't even updated anything):
- What went wrong: Could not determine the dependencies of task ':app:mockableAndroidJar'.
java.lang.NullPointerException (no error message)
My build.gradle file doesn't seem to properly recognize Strings:
buildToolsVersion cannot be applied to (java.lang.String)
and puts an error in every line that assigns a String.
Here's my build.gradle (nothing special):
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.dkslf.fragmenttest"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v13:22.0.0'
}
What could be wrong here?
EDIT: A combination of restarting the PC, restarting Android studio and randomly punching my keyboard seemed to solve the issue for now. I'll leave the question open though and see if I can reproduce it.
Recently ran into this but is not pretty sure if we are on the same boat. However, this is how I fixed that mockableAndroid problem:
- classpath 'com.android.tools.build:gradle:1.3.0'
+ classpath 'com.android.tools.build:gradle:2.0.0-beta6'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With