dex

关于使用android studio时的一些错误整理

穿精又带淫゛_ 提交于 2019-12-06 15:30:42
导入一些demo的时候,比较慢,会卡在进度条上,而且还影响整个studio不能进行操作,一般我都是先断网导入,然后再把这个gradle改成本地自己的(复制能运行的项目里的就好).... 1、android studio 导入项目时Error:SSL peer shut down incorrectly 导入项目到studio,显示在下载1.1.0-rc4。 报了这个错,网上搜了下说是 Android SDK Manager下载SDK报错:Download interrupted: SSL peer shut down incorrectly 还需要设置一些文件什么的,看着挺麻烦的 然后到这里看了下 、 对照着自己能正常运行的项目改了一下就好了,也可以在gradle里改 2、 android studio编译时Error:(6, 34) 错误: 程序包android.support.annotation不存在,或者是读取不到xxx版本的annotation 这个出现的原因应该比较少,纯粹个人手贱,鼓捣坏了。fx看了下,大部分是说依赖包的问题,或者是版本不兼容的问题之类的。那些去查就好了,这里只是针对我自己的。网速不好的话,不建议 把这两个删掉,然后重新下载就ok了。 3、clean的时候出现如下错误 Error:Execution failed for task ':app

RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex解决方法

陌路散爱 提交于 2019-12-06 12:54:05
在Android开发过程中都避免不了要集成第三方的项目、集成完之后今天碰到这个令人我非常不开心的transformClassesWithDexForDebug Exception、详细的Log如下: Error:java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 1 2 或者会出现如下的异常: Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 1 2 ###查阅了好多资料和别人的一些解决方法,如: ##1、第一种: defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ... //Enabling multidex

如何查看Gradle项目的依赖树情况-排查 Unable to merge dex问题

≯℡__Kan透↙ 提交于 2019-12-06 12:28:08
一、问题描述 今天在编写代码过程中,引入了一个组内新的封装库,导致编译冲突。如下所示: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':demo:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org BUILD FAILED in 8s 51 actionable tasks: 13 executed, 38 up-to-date 1 2 3 4 5 6 7 8 9 10 11 12 13 点击 【Run with -

Android 逆向分析(一) 之 Smali语法

ぃ、小莉子 提交于 2019-12-06 08:33:07
Smali 语法 引言 大家都知道apk安装包其实就是个zip包,我们通过解压软件解压出来会看到里面的架构 assets META_INF 存放签名信息 lib arm ... res AndroidManifest.xml classes.dex Java代码编译得到的Dalvik VM能直接执行的文件 resources.arsc asset和res资源目录的不同在于: 1. res目录下的资源文件在编译时会自动生成索引文件(R.java),assets的资源文件不需要生成索引,在Java代码中需要用AssetManager来访问 2. 一般来说,除了音频和视频资源(需要放在raw或asset下),使用Java开发的Android工程使用到的资源文件都会放在res下;使用C++游戏引擎(或使用Lua binding等)的资源文件均需要放在assets下。 Dalvik Dalvik虚拟机是Google等厂商合作开发的Android移动设备平台的核心组成部分之一。 它可以支持已转换为 .dex格式的Java应用程序的运行,.dex格式是专为Dalvik设计的一种压缩格式,适合内存和处理器速度有限的系统。 Dalvik 经过优化,允许在有限的内存中同时运行多个虚拟机的实例,并且每一个Dalvik 应用作为一个独立的Linux 进程执行

Kotlin compiler on android

旧街凉风 提交于 2019-12-06 06:23:57
问题 I'm trying to create a dex of the huge jar of the kotlin commandline compiler, so I can develop (i.e. compile) kotlin on a phone (in termux ). But dx runs out of RAM and is "Killed". So, maybe divide into smaller dex s, and run as multidex? (also, close all other apps!) Divide into dex s : fully extract the jar to files; separate with parallel directory structures; then apply dx to create one dex per root. This worked, and I found dx could handle up to 13MB of classes, and I got the total

Mockito on Android emulator

浪子不回头ぞ 提交于 2019-12-06 06:11:20
问题 Android newbie here trying to use my favorite Java testing tools in Android. I am attempting to use Mockito 1.9.5 as outlined in the following blog post but cannot get the tests to run on my emulator (I currently do not have a physical device to test with either). Mockit-Android Tutorial: http://www.paulbutcher.com/2012/05/mockito-on-android-step-by-step/ I am able to execute all my normal Junit tests without issue however any of the tests I have leveraged Mockito for I receive the following:

Android: Didn't find class “Picasso” on path: DexPathList (Failed resolution of: Picasso)

假如想象 提交于 2019-12-06 01:11:10
First of all I know this error has been asked already but my case is a little different: I'm distributing SDK (Android library project). My SDK needs among others things (play services, support v4, gson jars etc.) Picasso so I have in my gradle.build : compile 'com.squareup.picasso:picasso:2.5.2' Now when I test importing the resulted aar file from this library project to my sample app - all works fine. The problem is that my customer when importing the aar file into his app project, trying to launch inside his app the Activity related with my SDK functionality getting the above error: Failed

Decompiling and recompiling APK file

一世执手 提交于 2019-12-05 22:35:11
I'm currently working on analyzing some android malwares and i need to decompile APK files. Reading an answer and many other answers like it, i know that we can extract java source code and other resources, create a new project and put those files in, make some modifications and compile the project. Is this approach applicable to every APK file ? If we aim to make very little or no modifications in the java source code, does this approach work for every APK file? If not, what is the main reason? As another question, i remember i read somewhere (can not find it now) that said converting dex to

Class resolved by unexpected DEX;

╄→гoц情女王★ 提交于 2019-12-05 21:35:31
I am developing a application which automatically load class from external dex from external apk file (external apk file is stored in internal storage of application). The external apk file have class using com.google.gson. The source code of the application // Internal storage where the DexClassLoader writes the optimized dex file to. final File optimizedDexOutputPath = mContext.getDir("optimize_offload", Context.MODE_PRIVATE); // Initialize the class loader with the s dex file. DexClassLoader dexClassLoader = new DexClassLoader(apkPath, optimizedDexOutputPath.getAbsolutePath(), null,

Dexopt failed on a very big APK (Out-of-order method_idx) when dex.force.jumbo=true

穿精又带淫゛_ 提交于 2019-12-05 18:49:07
问题 I have a very big Android project with a multiple, big, 3rd party jars (as Android Libraries). I believe I've hit a Dex's max number of method limitation (compiling via eclipse): [2012-11-18 02:28:45 - Find In Files] Dx processing classes.dex... [2012-11-18 02:28:48 - Dex Loader] Unable to execute dex: Cannot merge new index 66774 into a non-jumbo instruction! [2012-11-18 02:28:48 - Find In Files] Conversion to Dalvik format failed: Unable to execute dex: Cannot merge new index 66774 into a