[英]Android Studio: error: cannot find symbol variable AudioSystem
我的项目在运行时出现错误: error: cannot find symbol variable AudioSystem
我已确保代码已导入:
import android.media.AudioSystem;
并且已经安装了SDK版本19和我的build.Gradle信息如下:
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
minSdkVersion 19
targetSdkVersion 23
如何克服这个错误? 谢谢
当我在“ import android.media。”之后输入字母“ A”时,“自动”列表未显示AudioSystem让我选择。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
}
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile files('3rd_party_library/dom4j-1.6.1.jar')
compile files('3rd_party_library/jaxen-1.1-beta-7.jar')
compile files('3rd_party_library/core-3.2.1.jar')
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.test.smmitest"
minSdkVersion 19
targetSdkVersion 23
versionCode 20170713
versionName "4.5.6"
}
dexOptions {
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
signingConfigs {
release {
}
debug {
storeFile file("Keystore/debug.keystore");
storePassword ("android");
keyAlias = "androiddebugkey";
keyPassword = "android";
}
}
buildTypes {
release {
}
debug {
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.