无法解析导入com.google.devtools.simple.runtime.events.EventDipatcher
问题描述:
我需要类中的Label和EventDispatcher在我的代码中,并通过互联网搜索,我发现它们在谷歌devtools中找到,但是,既不Eclipse和Android Studio都无法解析这个库。我拥有最新的Google Repository和Google Play服务。找不到解决方案,新的android编码,帮助?无法解析导入com.google.devtools.simple.runtime.events.EventDipatcher
package com.brr.uet.robo;
import com.google.devtools.simple.runtime.components.Component;
import com.google.devtools.simple.runtime.components.HandlesEventDispatching;
import com.google.devtools.simple.runtime.components.android.ActivityStarter;
import com.google.devtools.simple.runtime.components.android.Button;
import com.google.devtools.simple.runtime.components.android.Form;
import com.google.devtools.simple.runtime.components.android.HorizontalArrangement;
import com.google.devtools.simple.runtime.components.android.Label;
import com.google.devtools.simple.runtime.components.android.Notifier;
import com.google.devtools.simple.runtime.events.EventDispatcher;
public class MainActivity extends Form implements HandlesEventDispatching {
private Label touchZombieLabel;
private HorizontalArrangement horizontalArrangement1;
private Button zombieButton;
private AccelerometerSensor accelerometerSensor1;
}
错误表示“无法解析符号'devtools'”?
答
请确保您的进口是如下,可能是一些错误的进口是否有这就是为什么你面临的问题。
import com.google.devtools.simple.runtime.components.android.Button;
import com.google.devtools.simple.runtime.components.Component;
import com.google.devtools.simple.runtime.components.HandlesEventDispatching;
import com.google.devtools.simple.runtime.components.android.Form;
import com.google.devtools.simple.runtime.components.android.HorizontalArrangement;
import com.google.devtools.simple.runtime.components.android.Label;
import com.google.devtools.simple.runtime.events.EventDispatcher;
答
明白了,我没有加入到我的库项目中的“libSimpleAndroidRuntime.jar”文件。一旦我添加它,一切都很顺利。
用导入粘贴你的代码,这样可以检查你错误的地方。 –
请现在检查 –