- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试使用自 2015 年以来未更新的项目文件中的最新 SDK 构建一个 Android 应用程序。通过一些工作,我已经设法构建和安装它,但是当我启动时,我得到了一个我找不到太多信息的错误:“java.io.IOException: No original dex files found for dex location”。
这是错误的全文:
03-19 23:32:37.418 10121 10121 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.xxx.xxx/com.xxx.xxx.LaunchActivity}: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.LaunchActivity" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm, /system/fake-libs, /data/app/com.xxx.xxx-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2604)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2788)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1503)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6209)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.LaunchActivity" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm, /system/fake-libs, /data/app/com.xxx.xxx-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1094)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2594)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: ... 9 more
03-19 23:32:37.418 10121 10121 E AndroidRuntime: Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.xxx.xxx-1/base.apk
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexFile.openDexFileNative(Native Method)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexFile.openDexFile(DexFile.java:373)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexFile.<init>(DexFile.java:113)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexFile.<init>(DexFile.java:78)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexPathList.loadDexFile(DexPathList.java:359)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexPathList.makeElements(DexPathList.java:323)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.DexPathList.<init>(DexPathList.java:126)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:525)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.LoadedApk.getClassLoader(LoadedApk.java:558)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1902)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.LoadedApk.getResources(LoadedApk.java:774)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ContextImpl.<init>(ContextImpl.java:2083)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ContextImpl.createAppContext(ContextImpl.java:2028)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5383)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread.-wrap2(ActivityThread.java)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1571)
03-19 23:32:37.418 10121 10121 E AndroidRuntime: ... 6 more
这里是相关的dex输出:
-dex:
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/bin/classes
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_apk_expansion/downloader_library/bin/classes.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_licensing/library/bin/classes.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/crittercism_v1_3_0.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/jackson-mapper-asl-1.8.4.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_apk_expansion/downloader_library/libs/android-support-v4.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/dropbox-android-sdk-1.5.4.jar
[dex] input: /Users/alvion/Library/Android/sdk/tools/support/annotations.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/ouya-sdk.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/guava-r09.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/in-app-purchasing-1.0.3.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/jackson-core-asl-1.8.4.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/json_simple-1.1.jar
[dex] input: /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/commons-lang-2.6.jar
[dex] Pre-Dexing /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_apk_expansion/downloader_library/bin/classes.jar -> classes-81c328b1bd235b3a63ab7b7dc3612832.jar
[dex] Using Pre-Dexed classes-8402751112432f9e98dc60e91b59aa39.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_licensing/library/bin/classes.jar
[dex] Using Pre-Dexed crittercism_v1_3_0-3d69c6e931684bd63dfe2e833d0aebe6.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/crittercism_v1_3_0.jar
[dex] Using Pre-Dexed jackson-mapper-asl-1.8.4-ffc362a66f3bc5bb8073e3401c4d7c7b.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/jackson-mapper-asl-1.8.4.jar
[dex] Using Pre-Dexed android-support-v4-39781f5ab2494414fb73e335497fb91d.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/google/play_apk_expansion/downloader_library/libs/android-support-v4.jar
[dex] Using Pre-Dexed dropbox-android-sdk-1.5.4-e975c3510f4992bd1ed860294caaaec6.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/dropbox-android-sdk-1.5.4.jar
[dex] Using Pre-Dexed annotations-812d332b38fbdb408dd663820ddaf9f6.jar <- /Users/alvion/Library/Android/sdk/tools/support/annotations.jar
[dex] Using Pre-Dexed ouya-sdk-7728ab2d7956de1baa1d2087c8b3543b.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/ouya-sdk.jar
[dex] Using Pre-Dexed guava-r09-e1a6934eeb9a0381c562ff20974676c2.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/guava-r09.jar
[dex] Using Pre-Dexed in-app-purchasing-1.0.3-fa4d8ee5ba37ef3c2e63307e237f5958.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/in-app-purchasing-1.0.3.jar
[dex] Using Pre-Dexed jackson-core-asl-1.8.4-d94d4ec863304731c24c400b1f59e0be.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/jackson-core-asl-1.8.4.jar
[dex] Using Pre-Dexed json_simple-1.1-162e5f2c569f2c90fd6fa9067260bced.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/json_simple-1.1.jar
[dex] Using Pre-Dexed commons-lang-2.6-73a87249d3e4206fda186982d953eb0b.jar <- /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/libs/commons-lang-2.6.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /Users/alvion/df/xxx/xxx/Code/Host-Ant/Game/bin/classes.dex...
[dx] Merged dex #1 (87 defs/139.5KiB)
[dx] Merged dex #2 (371 defs/436.8KiB)
[dx] Merged dex #3 (2 defs/1.1KiB)
[dx] Merged dex #4 (50 defs/90.6KiB)
[dx] Merged dex #5 (25 defs/35.5KiB)
[dx] Merged dex #6 (133 defs/331.3KiB)
[dx] Merged dex #7 (69 defs/199.7KiB)
[dx] Merged dex #8 (73 defs/84.7KiB)
[dx] Merged dex #9 (883 defs/1023.2KiB)
[dx] Merged dex #10 (85 defs/58.1KiB)
[dx] Merged dex #11 (129 defs/232.0KiB)
[dx] Merged dex #12 (432 defs/535.7KiB)
[dx] Merged dex #13 (12 defs/21.8KiB)
[dx] Merged dex #14 (204 defs/181.7KiB)
[dx] Result is 2555 defs/4209.8KiB. Took 0.6s
关于应用的一些细节:
无法安装 drm_free/Xxx-debug.apk: 失败 [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: 无法读取 android.util.jar.StrictJarFile@710a502 中的 assets/some/random/asset.bin: META-INF/MANIFEST.MF assets/some/random/asset.bin 中 assets/some/random/asset.bin 的摘要无效]
我能找到的唯一相关问题是 this one但这似乎并不相关,因为这个应用程序中实际的 Java 代码很少,所以达到 dex 方法限制没有意义。那里提供的解决方案非常重要,因为我需要在构建过程中设置的 multiDexEnabled 属性似乎只在 gradle 构建文件中公开,而我没有,因为这是一个遗留项目。
最佳答案
在我的情况下,设置 > 构建、执行、部署 > 即时运行
取消选中“启用即时运行以在部署时热交换代码/资源更改”
工作正常。
关于android - java.io.IOException : No original dex files found for dex location,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42897739/
我们有一个连接到某些网络服务的 Windows 窗体应用程序。它列出了系统中的文档,当用户双击一个文件时,我们将文件下载到本地计算机并打开文档供他们编辑。一旦用户关闭文档,我们就会将其上传回系统。 对
public class SampleCloseable implements AutoCloseable { private String name; public SampleCl
我正在尝试使用 JAVA 运行一个简单的 sqoop 导入程序。 我的程序: String driver="com.vertica.Driver"; Configuration con
我需要从 Java 执行一个外部程序(使用 libreoffice 将 fodt 文件转换为 pdf,就这样发生了)我知道该程序所需的精确命令行: /usr/bin/libreoffice --hea
AFAIK,标准try-with-resources 形式 try(InputStream is= new ...){ ... some reading from is } catch (..
我观察到这两种说法都是有效的。与第二个语句相比,第一个语句中记录的额外内容是什么? 最佳答案 第一个还记录原始异常(和堆栈跟踪),第二个仅记录消息。 因此,第一个语句中记录的“额外内容”是原始异常。这
我想执行重命名和删除功能,环境是LINUX。这是我正在使用的代码, String[] command_ary = { "/usr/bin/sh", "-c", command }; Runtime r
在使用 selenium webdriver 实现 Web 应用程序的自动化时,我遇到了一种情况,我需要上传文件并进一步继续。 我们为此使用 Java 和 Tcl 脚本语言。 下面是我的 TCL 代码
我正在尝试使用 ANT 将文件从一个目录复制到 Linux 上的另一个目录。 首先我使用了复制任务,它工作正常但文件模式没有保留。然后我改为使用 ,这就是我卡住的地方。 我的目标是这样的:
当我输入命令时: ./sqoop-import --connect jdbc:mysql://localhost/sqoop2 -table sqeep2 -m 1 -hive-import 当执行这
我正在使用 Sun 的 keytool 创建一个 Bouncy caSTLe keystore 并将证书导入其中。 keytool 确实会生成一个 Bouncy caSTLe 格式的 keystore
我正在执行下面的程序,它通过 java 调用 shell,我得到了异常请帮助我。 程序: import java.io.*; import java.util.*; public class Proc
我在我的一个项目中遇到了这个错误。 FAILURE: Build failed with an exception. What went wrong: Execution failed for tas
什么情况下read end可以死对偶PipedOutputStream和 PipedInputStream ?我没有关闭任何管道。 最佳答案 我遇到了java.io.IOException: Read
我有一段从文件中读取数据的代码。我想在此代码中强制 IOException 用于测试目的(我想检查代码在这种情况下是否抛出正确的自定义异常)。 例如,有什么方法可以创建一个防止被读取的文件?也许处理一
我为MapReduce文本排序编写了这样的代码: public static class SortMapper extends Mapper { private Text citizenshi
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我要createNewFile有一条路径,但我得到了一个 IOException。问题是,详细的消息无法解释,我只能看到一堆问号。 我最初使用的是西类牙语的 Windows 10,但安装了中文语言包。
我认为这是基本的东西,但我不知道该怎么做。为什么我得到 IOException never throw in body of相应的 try 语句 public static void main(Str
我正在从 Java 项目中的类路径读取文件。 示例代码: public static Properties loadPropertyFile(String fileName) {
我是一名优秀的程序员,十分优秀!