gpt4 book ai didi

Android 模拟器在没有警告的情况下关闭

转载 作者:太空狗 更新时间:2023-10-29 12:59:22 25 4
gpt4 key购买 nike

我正在使用 Linux Pop!OS 19.04 并尝试安装 Android Emulator。它会启动,但每次都会在大约 30 秒内关闭。

我通过“OpenJDK-8-JDK”安装了 Java 8,我可以成功构建 Android 包并将它们毫无问题地加载到我的手机上。

将 Android SDK 安装到/usr/local/android 之后,我就是这样做的;

  1. 进入tools bin目录

    cd /usr/local/android/sdk/tools/bin
    sudo chmod +x
  2. 安装系统镜像(必须以 root 身份完成)

    sudo ./sdkmanager "system-images;android-25;google_apis;x86"
    sudo ./sdkmanager --licenses

    对所有人说“y” sudo touch ~/.android/repositories.cfg

  3. 列出要安装的可用 Android 虚拟设备(以用户身份完成)

    ./avdmanager list
  4. 创建测试 Android 虚拟设备 (AVD)

    ./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

    自定义硬件配置文件:否

  5. 列出 AVD

    现在我通过 avdmanager 列出时得到以下信息

    ./avdmanager list avd
    Available Android Virtual Devices:
    Name: test
    Path: /root/.android/avd/test.avd
    Target: Google APIs (Google Inc.)
    Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86
  6. 启动模拟器

    cd /usr/local/android/sdk/emulator
    ./emulator -avd test

然后加载模拟器,我可以启动应用程序并四处浏览,直到它崩溃/关闭程序。

我尝试安装 Android Studio 并通过那里设置 AVD,同样的事情发生了。我已经为我的 AVD 尝试了不同的模型和安卓版本,同样的事情。

更新:记录一次崩溃

我设法通过使用记录了一次崩溃

$ANDROID_HOME/emulator/emulator -avd test -gpu guest -logcat v

日志

08-22 13:50:03.169  2703  2839 V NativeCrypto: Read error: ssl=0xb0a32640: I/O error during system call, Connection reset by peer
08-22 13:50:03.170 2703 2839 V NativeCrypto: SSL shutdown failed: ssl=0xb0a32640: I/O error during system call, Broken pipe
08-22 13:50:03.195 3551 3551 W dex2oat : Unexpected CPU variant for X86 using defaults: x86
08-22 13:50:03.195 3551 3551 W dex2oat : Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,-lock_add,-popcnt) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2,-lock_add,-popcnt) for the command line:
08-22 13:50:03.195 3551 3551 W dex2oat : /system/bin/dex2oat --runtime-arg -classpath --runtime-arg & --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2,-lock_add,-popcnt --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/user/0/com.google.android.gms/app_fb/f.apk --oat-fd=44 --oat-location=/data/user/0/com.google.android.gms/app_fb/f.dex --compiler-filter=speed
08-22 13:50:03.195 3551 3551 I dex2oat : /system/bin/dex2oat --dex-file=/data/user/0/com.google.android.gms/app_fb/f.apk --oat-fd=44 --oat-location=/data/user/0/com.google.android.gms/app_fb/f.dex --compiler-filter=speed
08-22 13:50:03.232 3551 3551 I dex2oat : dex2oat took 36.457ms (threads: 2) arena alloc=323KB (331648B) java alloc=76KB (78168B) native alloc=966KB (989744B) free=2MB (2155984B)
08-22 13:50:03.234 2703 2839 W System : ClassLoader referenced unknown path:
08-22 13:50:03.253 2022 3550 I GoogleURLConnFactory: Using platform SSLCertificateSocketFactory
08-22 13:50:03.262 2022 3550 I GoogleURLConnFactory: Using platform SSLCertificateSocketFactory
08-22 13:50:03.387 2022 2716 W ConfigurationChimeraPro: Got null configs for com.google.android.gms.auth.account.base
08-22 13:50:03.415 2022 2716 W Conscrypt: Could not set socket write timeout:
08-22 13:50:03.416 2022 2716 W Conscrypt: java.lang.reflect.Method.invoke(Native Method)
08-22 13:50:03.416 2022 2716 W Conscrypt: com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@11743470:13)
08-22 13:50:03.552 2022 2716 W Conscrypt: Could not set socket write timeout:
08-22 13:50:03.552 2022 2716 W Conscrypt: java.lang.reflect.Method.invoke(Native Method)
08-22 13:50:03.552 2022 2716 W Conscrypt: com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@11743470:13)
08-22 13:50:03.678 2022 2716 W GLSUser : [AppCertManager] IOException while requesting key:
08-22 13:50:03.678 2022 2716 W GLSUser : java.io.IOException: Invalid device key response.
08-22 13:50:03.678 2022 2716 W GLSUser : at eyw.a(:com.google.android.gms@11743470:14)
08-22 13:50:03.678 2022 2716 W GLSUser : at eyw.a(:com.google.android.gms@11743470:65)
08-22 13:50:03.678 2022 2716 W GLSUser : at eyu.a(:com.google.android.gms@11743470:8)
08-22 13:50:03.678 2022 2716 W GLSUser : at eyq.a(:com.google.android.gms@11743470:1)
08-22 13:50:03.678 2022 2716 W GLSUser : at eyp.a(:com.google.android.gms@11743470:10)
08-22 13:50:03.678 2022 2716 W GLSUser : at com.google.android.gms.auth.account.be.legacy.AuthCronChimeraService.b(:com.google.android.gms@11743470:7)
08-22 13:50:03.678 2022 2716 W GLSUser : at edr.call(:com.google.android.gms@11743470:3)
08-22 13:50:03.678 2022 2716 W GLSUser : at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-22 13:50:03.678 2022 2716 W GLSUser : at mmu.run(:com.google.android.gms@11743470:26)
08-22 13:50:03.678 2022 2716 W GLSUser : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
08-22 13:50:03.678 2022 2716 W GLSUser : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
08-22 13:50:03.678 2022 2716 W GLSUser : at mse.run(:com.google.android.gms@11743470)
08-22 13:50:03.678 2022 2716 W GLSUser : at java.lang.Thread.run(Thread.java:761)
08-22 13:50:07.717 1603 1634 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.drive.ApiService.RESET_AFTER_BOOT flg=0x4 cmp=com.google.android.gms/.drive.api.ApiService (has extras) } U=0: not found
emulator: Saving state on exit with session uptime 119964 ms

更新:config.ini

这是我的config.ini

PlayStore.enabled = false
abi.type = x86
avd.ini.encoding = UTF-8
hw.accelerometer = yes
hw.audioInput = yes
hw.battery = yes
hw.cpu.arch = x86
hw.dPad = no
hw.device.hash2 = MD5:fc85b2d34337b54227366eb43de4cfef
hw.device.manufacturer = Generic
hw.device.name = 5.4in FWVGA
hw.gps = yes
hw.lcd.density = 160
hw.lcd.height = 854
hw.lcd.width = 480
hw.mainKeys = yes
hw.sdCard = yes
hw.sensors.orientation = yes
hw.sensors.proximity = yes
hw.trackBall = no
image.sysdir.1 = system-images/android-24/google_apis_playstore/x86/
sdcard.size = 2048M
tag.display = Google Play
tag.id = google_apis_playstore
disk.dataPartition.size = 6442450944
hw.ramSize=3072

更新:另一个崩溃日志

这次它不会提示丢失的 key 。

08-28 09:48:58.109 12476 12476 W art     : Unexpected CPU variant for X86 using defaults: x86
08-28 09:48:58.114 12476 12476 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
08-28 09:48:58.129 12476 12476 E memtrack: Couldn't load memtrack module (No such file or directory)
08-28 09:48:58.129 12476 12476 E android.os.Debug: failed to load memtrack module: -2
08-28 09:48:58.130 12476 12476 I Radio-JNI: register_android_hardware_Radio DONE
08-28 09:48:58.139 12476 12476 D AndroidRuntime: Calling main entry com.android.commands.settings.SettingsCmd
08-28 09:48:58.144 12476 12476 D AndroidRuntime: Shutting down VM
emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

08-28 09:49:03.851 1602 2032 D AlarmManagerService: Kernel timezone updated to -600 minutes west of GMT
08-28 09:49:03.852 1602 2030 D AlarmManagerService: Setting time of day to sec=1566949744
08-28 09:49:04.002 1602 2030 W AlarmManagerService: Unable to set rtc to 1566949744: No such device
[ 8042.781849] healthd: battery l=100 v=0 t=0.0 h=2 st=2 chg=a
emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

emulator: emulator_window_fb_update

emulator: Saving state on exit with session uptime 73706 ms

解决方法

创建一个每次崩溃时重启模拟器的别名。

alias tnsa="tns run android --device emulator-5554"   # Run in emulator
alias em="$ANDROID_HOME/emulator/emulator -avd samsung_galaxy_s8 -gpu guest -no-audio -verbose"
alias eml="while true; do pkill -f android; sleep 2; tnsa &; em &> ~/emulator.log; done"

这很糟糕,但我目前正在使用的是什么。

最佳答案

原因是您安装了带模拟器的工作室的桌面没有足够的磁盘空间。请尝试清理一些空间并重新运行设备,否则尝试创建新的模拟器没有帮助。希望它有帮助.

关于Android 模拟器在没有警告的情况下关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57068752/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com