gpt4 book ai didi

java - 不幸的是,如何解决myapp已停止的问题?

转载 作者:行者123 更新时间:2023-12-03 08:49:45 25 4
gpt4 key购买 nike

在Android Studio中,我成功生成了已签名的apk,然后在Android手机和Android模拟器中下载了我的apk,不幸的是,它显示myapp已停止。如何解决这个问题呢?

这是logcat错误报告------------>

05-01 14:03:13.824 1267-1267/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-as.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-as.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722) 
05-01 14:03:13.824 1267-1267/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-bn.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-bn.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722) 
05-01 14:03:13.824 1267-1267/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-cy.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-cy.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722) 
05-01 14:03:13.825 1267-1267/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-da.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-da.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722) 
05-01 14:03:13.825 1267-1267/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-de-1901.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-de-1901.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:722)

最佳答案

我认为问题与内存泄漏或较小的堆内存大小有关,因此请注意
尝试在您的应用程序build.gradle文件中使用 multiDexEnabled true
就像是

android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0.0.0.0.0"

multiDexEnabled true
}

dexOptions {
javaMaxHeapSize "4g"
}
}

然后在您的AndroidManifiedt.xml文件中添加应用程序标记 android:largeHeap =“true”
 <application
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:largeHeap="true"
android:screenOrientation="portrait">

请提供有关问题的更多信息

关于java - 不幸的是,如何解决myapp已停止的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43914570/

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