我终于要从 Eclipse 迁移到 Android Studio,但连一个小模块都无法连接。
这是资源中唯一的文件 - 正如您通过屏幕截图所见,那里没有错误
但是在需要它的类中,'R'没有被解析。所以我很困惑——没有太多需要研究的地方
App 的模块有问题,因为我还没有 hook 所有的库,但 'dragsortlib' 模块没有明显的问题。 我清理并重建了项目,但这没有帮助。
list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mobeta.android.dslv"
android:versionCode="4"
android:versionName="0.6.1">
<uses-sdk android:targetSdkVersion="7"
android:minSdkVersion="7" />
</manifest>
渐变:
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "24.0.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
compile files('libs/android-support-v4.jar')
testCompile 'junit:junit:4.12'
}
最佳答案
点击 Build -> Rebuild Project 然后点击 Tools -> Android -> Sync Project with Gradle Files。
您可以引用here
关于android - 无法解析模块中的符号 'R',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40544291/