【发布时间】:2013-05-24 02:10:57
【问题描述】:
我正在尝试在我的 android 应用程序中导入一些 javax.* 类,但我在 Android Studio 中不断收到编译器错误。
我使用的是 Ubuntu Linux 13.04。
这是我的导入:
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
// Here are the imports I am having trouble with:
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.SourceDataLine;
当我尝试运行应用程序甚至编译活动 java 文件时,我收到以下错误:
Gradle: error: package javax.sound.sampled does not exist
Gradle: error: package javax.sound.sampled does not exist
Gradle: error: package javax.sound.sampled does not exist
我就是想不通这个问题。任何帮助都会很棒!
【问题讨论】:
-
你检查你的类路径了吗?确保您已添加系统库。
-
如何添加到系统库中?顺便说一句,感谢您的帮助。
-
我不确定 Android 开发。但这里是来自 Eclipse 透视图的路径.... 右键单击 Project Explorer --> Build Path --> Configure Build Path --> Library 选项卡 --> Add Library 按钮 --> 选择 JRE System Library --> Next -- > 完成
-
你想用音频类做什么?
-
看起来你想做的事情可以使用 Android
AudioTrack类来实现。请参阅:stackoverflow.com/questions/10158409/… 和 stackoverflow.com/questions/11436472/…
标签: java android gradle javax.sound.sampled