0

I am new to android. I am doing one project in that i want to use jar file. Actually I converted .apk file to .jar file by using dex2jar. I added that .jar file in lib folder and added as library. but when running the app it shows an error: Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

and my build.gradle file is

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.protocolnet.myapplication"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        preDexLibraries = false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile files('libs/viabee-dex2jar.jar')
}

. How to get rid from that error. Please anybody help me?

1 Answers1

0

You can't use .jar file converted from apk as a Library because of that it is not Library. You can get source code using this method.

Community
  • 1
  • 1
AliNadi
  • 500
  • 4
  • 12
  • thank u. I got source code from that method. But when I importing that project into android studio it asking import project from external model if I select that what will be the gradle location how to select that? – 19910319 Jul 13 '15 at 07:53
  • If that is a gradle project select project main path. There must be a build.gradle file. – AliNadi Jul 13 '15 at 09:07
  • I only created build.gradle file. Is that fine? If I want to use that code in my project when a button is clicked then what to do? – 19910319 Jul 13 '15 at 09:35
  • Find the source code that button onClick listener. Copy and paste to your onClickListener. – AliNadi Jul 13 '15 at 10:41