My R library is red, but I can normally create and run the application

I am using compile project(':pickphotos') to include a library called pickphotos.

R in pickphotos is red, although I have me.crosswall.photo.pick.RI I can normally create and run the application.

enter image description here

When I use Alt + Enter, it shows some solution:

enter image description here

When I use Move 'R' in pickphotos, it shows some R:

enter image description here

But if I take me.crosswall.photo.pick.R, I will get a repeated R error in my next build.

Below is the pickphotos assembly:

 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:

enter image description here

Android Studio does not have a Mark object:

enter image description here

+7
android android-studio android-gradle android-library
source share
2 answers

I finally found this.

Just create a project.

R is created when a project is created.

I think that when we launch a project or create a project, Android Studio does not do the project for some reason.

+1
source share

Going to assembly> Reconstructing a project and / or a Clean project seems to be goto's first attempt to fix any errors related to brief errors. It’s better to do this, and then spend 45 minutes looking at the code, trying to figure out what is wrong when the answer is β€œnothing” ...

0
source share

All Articles