我有一个使用 Android Studio 创建的 Android 虚拟设备,我必须从命令行启动它以满足自定义需求。
启动此命令:
C:\Users\jonathan\AppData\Local\Android\Sdk\tools>emulator.exe -avd Pixel_3_API_30 -writable-system
Run Code Online (Sandbox Code Playgroud)
(这-writable-system是因为我需要覆盖该/etc/host/文件)
我收到此错误:
PANIC: Missing emulator engine program for 'x86' CPU.
Run Code Online (Sandbox Code Playgroud)
详细运行:
C:\Users\jonathan\AppData\Local\Android\Sdk\tools>emulator.exe -avd Pixel_3_API_30 -writable-system -verbose
emulator:Android emulator version 26.0.3.0 (build_id 3965150)
emulator:Found AVD name 'Pixel_3_API_30'
emulator:Found AVD target architecture: x86
emulator:argv[0]: 'emulator.exe'; program directory: 'C:\Users\jonathan\AppData\Local\Android\Sdk\tools'
emulator: Found directory: C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\
emulator:Probing for C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\/kernel-ranchu: file missing
emulator:Auto-config: -engine classic (based on configuration)
emulator: Found directory: C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\ …Run Code Online (Sandbox Code Playgroud) 我正在使用 avdmanager 创建一个 avd,以便在 Ubuntu 21.10 上与最新的 android 模拟器一起运行。
我使用的是 Android 模拟器版本 31.2.8。
当我使用系统映像 28 创建并 avd 时...
avdmanager create avd -n pixel_5 -k "system-images;android-28;google_apis_playstore;x86_64" --device "pixel_5"
Run Code Online (Sandbox Code Playgroud)
并运行它..
emulator -avd pixel_5
Run Code Online (Sandbox Code Playgroud)
然后我可以按住电源按钮,模拟器上的 Android 操作系统会正确关闭。
当我使用系统映像 30 或 31 创建并 avd 时...
avdmanager create avd -n pixel_5 -k "system-images;android-31;google_apis_playstore;x86_64" --device "pixel_5"
Run Code Online (Sandbox Code Playgroud)
一旦模拟器启动,如果我长按,电源按钮绝对不会执行任何操作。
android android-virtual-device android-emulator android-sdk-tools avd-manager
当我点击一个从3秒倒计时的按钮时,我想要一个计时器弹出.它确实很好,但我希望它也显示毫秒,所以当我点击按钮时,文本将从3.0变为0.1.如何将毫秒添加到文本视图?
new CountDownTimer(1000, 3000) {
public void onTick(long millisUntilFinished) {
textViewTimer.setText("" + millisUntilFinished / 1000);
}
public void onFinish() {
textViewTimer.setVisibility(View.INVISIBLE);
textViewLevelGained.setVisibility(View.INVISIBLE);
}
}.start();
Run Code Online (Sandbox Code Playgroud)
这就是我所拥有的
刚才我将Android SDK Tools更新为22.6,然后将ADT更新为22.6.但之后我无法在eclipse中运行我的android项目.我收到一条显示此消息的错误对话框,
调试UI中出错:java.lang.reflect.InvocationTargetException
我也应该更新DDMS吗?
这是错误窗口,

我在尝试运行" cordova platform add android " 时收到此错误消息:
" 错误:请安装Android目标19(Android最新版SDK).确保您安装了最新的Android工具.从您的通讯和线路运行"android"以安装/更新任何缺少的SDK或工具. "
但是,我安装了SDK(SDK Tools 23.0.2,SDK Platform-tools 20,SDK Build-tools 19.1).我将我的ANDROID_HOME设置为" C:\ Program Files\Android\android-sdk ".这是我计算机上环境变量PATH的尾部:
" ...; C:\ Program Files\Java\jdk1.7.0_67\bin; C:\ Program Files\Git\cmd; C:\ Program Files \nodejs \;%USERPROFILE%\ AppData\Roaming \npm; C :\ Program Files\Android\android-sdk\tools; C:\ Program Files\Android\android-sdk\platform-tools; C:\ Program Files\Android\android-sdk\build-tools;%USERPROFILE%\ AppData \漫游\npm; C:\ Program Files\WinAnt\bin "
谁能澄清我在这里做错了什么?如何使它工作?
嗨,大家好我有同样的问题:3.2 sdk平台安装问题."完成.没有安装任何东西"
但是所有类似的问题都已通过 - >右键单击/以管理员身份运行来解决.好吧,当我尝试这样做时,Windows会给我一个cmd窗口,上面写着:
"无法执行tools\android.bat:,错误2无法找到该文件"
和一个带有相同消息的弹出窗口
我怎么解决?
我一直在尝试编译这个简单的警告对话框,以便在用户单击提交按钮时显示.编译代码时会弹出一条错误消息:
错误:(33,74)错误:不兼容的类型:<anonymous OnClickListener>无法转换为Context
这个类叫做Login_Activity,它扩展了BaseActivity,扩展了Activity.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
mUserNameEt = (EditText) findViewById(R.id.login_username_et);
mPasswordEt = (EditText) findViewById(R.id.login_password_et);
mSubmitBtn = (Button) findViewById(R.id.login_submit_btn);
mSubmitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder messageBox = new AlertDialog.Builder(this);
messageBox.setTitle("Atlas Box");
messageBox.setMessage("Dictionary.");
}
});
}
Run Code Online (Sandbox Code Playgroud) 我在没有 GPU的情况下使用Netbeans 8.1和android-sdk for Linux .当我运行我的项目,或尝试启动模拟器时,我得到:
Starting emulator for AVD 'MG'
emulator: WARNING: VM heap size set below hardware specified minimum of 256MB
emulator: WARNING: Setting VM heap size to 512MB
emulator: ERROR: GPU emulation is disabled.
Only screen size of 768 X 1280 or smaller is supported when GPU emulation is disabled.
Run Code Online (Sandbox Code Playgroud)
细节是:
任何想法,请?
编辑:
如果我从cmd尝试使用相同的行为:
gsamaras @ gsamaras-A15:〜/ android-sdk-linux/tools $ ./emulator -avd MG
我已经安装了NativeScript,tns platform add android但我尝试这样做,但它不起作用.ANDROID_HOME路径是正确的,我已经安装了SDK(API 22和最新版本)和工具(25.0.2).我跑的tns doctor时候说:
WARNING: The Android SDK is not installed or is not configured properly.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=25.0.2'.
You need to have Android SDK 22 or later and the latest Android Support Repository …Run Code Online (Sandbox Code Playgroud) macos android android-sdk-tools nativescript angular2-nativescript