I use compile project(':pickphotos')
to include a library named pickphotos.
The R in pickphotos is red though I have me.crosswall.photo.pick.R.I can build and run the app normally.
When I use Alt+Enter , it shows some solution:
When I use Move 'R' in pickphotos, it shows some R:
But if I pick me.crosswall.photo.pick.R,I will get repeat R error in my next build.
Below is the build.gradle of pickphotos:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
dependencies {
}
I can also find it app/build/generated/source/r:
There is no Mark as item in menu in Android Studio:
I finally resloved it.
Just Make Project.
R is created when Make Project.
I think when we Run Project or Build Project,Android Studio doesn't Make Project for some reason.
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