集怡嘉
集怡嘉

Reputation: 23

android studio1.0.2 Local path doesn't exist

My English is not good :),sorry.

I am use studio to build Android Contacts apk, include Contacts, ContactsCommon(lib) and PhoneCommon().

now , when i run app , Local path doesn't exist.

Android SDK Tools 24.0.2 (newest)

build.gradle(project)

classpath 'com.android.tools.build:gradle:1.0.0'

gradle-wrapper.properties

distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip

I am try to follow methods:

https://stackoverflow.com/q/27436269/4397112

https://stackoverflow.com/a/21842216/4397112

https://stackoverflow.com/a/19667599/4397112

etc..

in my project's root directory, run:

gradlew clean packageDebug

  • What went wrong: Execution failed for task ':app:preDexDebug'.

    com.android.ide.common.internal.LoggedErrorException: Failed to run command: D:\Development\Android\Sdk\build-tools\21.1.2\dx.bat -JXmx4g --dex --output D:\AndroidStudioProjects\Contacts\app\build\intermediates\pre-dexed\debug\classes-jarjar_framework-5c27d5f8ec6e579f128703ae9232253b06c7d5 2e.jar D:\AndroidStudioProjects\Contacts\app\build\intermediates\exploded-aar\Contacts\ContactsCommon\unspecified\libs\classes-jarjar_framework.jar Error Code: 2 Output:

    trouble writing output: Too many method references: 81922; max is 65536.
    You may try using --multi-dex option.
    References by package:
        27 android
       147 android.accessibilityservice
       577 android.accounts
        33 android.alsa
       682 android.animation
        11 android.annotation
      5500 android.app
       542 android.app.admin
       401 android.app.backup
       140 android.app.job
        53 android.app.trust
        89 android.app.usage
       134 android.appwidget
      1750 android.bluetooth
       222 android.bluetooth.le
      1879 android.content
      1537 android.content.pm
       554 android.content.res
       532 android.database
       498 android.database.sqlite
       117 android.ddm
       168 android.drm
        30 android.emoji
        23 android.filterfw
       817 android.filterfw.core
        26 android.filterfw.format
        42 android.filterfw.geometry
        46 android.filterfw.io
        83 android.filterpacks.base
       410 android.filterpacks.imageproc
         6 android.filterpacks.numeric
        17 android.filterpacks.performance
        18 android.filterpacks.text
        29 android.filterpacks.ui
        18 android.filterpacks.videoproc
        21 android.filterpacks.videosink
        86 android.filterpacks.videosrc
       223 android.gesture
      1458 android.graphics
      1337 android.graphics.drawable
        40 android.graphics.drawable.shapes
        87 android.graphics.pdf
       532 android.hardware
       283 android.hardware.camera2
        19 android.hardware.camera2.dispatch
       339 android.hardware.camera2.impl
       462 android.hardware.camera2.legacy
        25 android.hardware.camera2.marshal
       213 android.hardware.camera2.marshal.impl
       137 android.hardware.camera2.params
       153 android.hardware.camera2.utils
       247 android.hardware.display
       431 android.hardware.hdmi
       167 android.hardware.input
       388 android.hardware.location
       174 android.hardware.soundtrigger
       231 android.hardware.usb
       442 android.inputmethodservice
      1053 android.location
      3957 android.media
       293 android.media.audiofx
        44 android.media.audiopolicy
        82 android.media.browse
        48 android.media.effect
        39 android.media.effect.effects
       141 android.media.projection
       645 android.media.session
       964 android.media.tv
       144 android.mtp
      2232 android.net
       102 android.net.dhcp
       408 android.net.http
       106 android.net.nsd
       819 android.net.wifi
       250 android.net.wifi.p2p
        96 android.net.wifi.p2p.nsd
         1 android.net.wimax
       455 android.nfc
        73 android.nfc.cardemulation
       175 android.nfc.tech
      1728 android.opengl
      2778 android.os
       266 android.os.storage
       874 android.preference
       655 android.print
         6 android.print.pdf
       169 android.printservice
       631 android.provider
      1854 android.renderscript
        35 android.sax
       272 android.security
       160 android.service.dreams
        76 android.service.fingerprint
        85 android.service.media
       275 android.service.notification
        39 android.service.persistentdata
         3 android.service.restrictions
        30 android.service.textservice
        70 android.service.trust
       199 android.service.voice
       137 android.service.wallpaper
       149 android.speech
       133 android.speech.srec
       579 android.speech.tts
        32 android.system
      1010 android.telecom
       958 android.telephony
        48 android.telephony.cdma
        14 android.telephony.gsm
        52 android.test
       812 android.text
       116 android.text.format
       374 android.text.method
       375 android.text.style
        49 android.text.util
       556 android.transition
       922 android.util
      5239 android.view
       591 android.view.accessibility
       274 android.view.animation
       473 android.view.inputmethod
       139 android.view.textservice
       934 android.webkit
      8709 android.widget
        19 com.android.i18n.phonenumbers
         2 com.android.i18n.phonenumbers.geocoding
       111 com.android.ims
       469 com.android.ims.internal
        24 com.android.internal
         7 com.android.internal.annotations
      1298 com.android.internal.app
        98 com.android.internal.appwidget
       130 com.android.internal.backup
        92 com.android.internal.content
        23 com.android.internal.database
         8 com.android.internal.http
        78 com.android.internal.http.multipart
       106 com.android.internal.inputmethod
        78 com.android.internal.location
        12 com.android.internal.logging
        51 com.android.internal.net
       961 com.android.internal.os
        23 com.android.internal.os.storage
       156 com.android.internal.policy
        27 com.android.internal.preference
       184 com.android.internal.statusbar
       403 com.android.internal.telecom
       969 com.android.internal.telephony
        94 com.android.internal.textservice
         3 com.android.internal.transition
       632 com.android.internal.util
       499 com.android.internal.view
        17 com.android.internal.view.animation
       616 com.android.internal.view.menu
      1723 com.android.internal.widget
       232 com.android.internal.widget.multiwaveview
        42 com.android.net
        20 com.android.okhttp
         3 com.android.org.bouncycastle.asn1.x509
         2 com.android.org.bouncycastle.util.encoders
         9 com.android.org.bouncycastle.util.io.pem
         9 com.android.org.bouncycastle.x509
        28 com.android.org.conscrypt
        69 com.android.server
         9 com.android.server.backup
        31 com.android.server.net
        13 com.google.android.collect
       313 com.google.android.gles_jni
       170 com.google.android.util
         1 dalvik.bytecode
        75 dalvik.system
         7 dalvik.system.profiler
         5 default
       241 java.io
       461 java.lang
         5 java.lang.ref
        39 java.lang.reflect
         2 java.math
       100 java.net
       118 java.nio
         7 java.nio.channels
        15 java.nio.charset
        40 java.security
        16 java.security.cert
         7 java.security.spec
        43 java.text
       437 java.util
        52 java.util.concurrent
        19 java.util.concurrent.atomic
        21 java.util.concurrent.locks
         6 java.util.jar
        13 java.util.logging
        16 java.util.regex
        29 java.util.zip
         8 javax.crypto
         2 javax.crypto.spec
        33 javax.microedition.khronos.egl
       267 javax.microedition.khronos.opengles
         1 javax.net
        27 javax.net.ssl
         8 junit.framework
         7 libcore.icu
         2 libcore.internal
        18 libcore.io
         5 libcore.net
         2 libcore.net.event
        29 libcore.util
         2 org.apache.commons.codec.binary
         4 org.apache.commons.logging
        16 org.apache.harmony.dalvik.ddmc
         2 org.apache.harmony.luni.internal.util
         2 org.apache.harmony.security.asn1
         6 org.apache.harmony.security.pkcs7
         1 org.apache.harmony.security.x509
         1 org.apache.harmony.xml
        30 org.apache.http
        10 org.apache.http.client
         4 org.apache.http.client.methods
         1 org.apache.http.client.params
         1 org.apache.http.conn
         4 org.apache.http.conn.scheme
         1 org.apache.http.conn.ssl
        10 org.apache.http.entity
         3 org.apache.http.impl
         3 org.apache.http.impl.client
         1 org.apache.http.impl.conn.tsccm
         3 org.apache.http.impl.entity
         6 org.apache.http.impl.io
         6 org.apache.http.io
        12 org.apache.http.message
        13 org.apache.http.params
         9 org.apache.http.protocol
        11 org.apache.http.util
         3 org.ccil.cowan.tagsoup
         2 org.kxml2.io
        13 org.xml.sax
         1 org.xml.sax.helpers
        34 org.xmlpull.v1
    
  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED
    Total time: 1 mins 34.902 secs

I guess maybe classes-jarjar_framework.jar too big. i am building android source now, i will find some jar instead of classes-jarjar_framework.jar tomorrow.

someone give some advice, thanks very much

update 12/28 2014

thank @stkent, finally, i use https://developer.android.com/tools/building/multidex.html#mdex-gradle To solve my problem. i love stack overflow.

when you encounter "Local path doesn't exist" problem, first you should know where is problem. so run

gradlew clean packageDebug

no --Debug , less infomation

next, solve it

My english is not good, sorry again :)

Upvotes: 2

Views: 916

Answers (2)

Qutbuddin Bohra
Qutbuddin Bohra

Reputation: 1205

Here i suggest two way may be help you.

  1. Change in your build.gradle file

    buildTypes { release { minifyEnabled false // Change Here proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }

  2. Go this path of your Computer(Windows Os) and change.

Path; Controlpanel>System>Advance System Setting>Environment Variable this will open popup . Add or Change under System Variable on PATH and give it value %SystemRoot%\system32

May be this will help you better

Upvotes: 0

gio
gio

Reputation: 5020

Your app has reached the 65K methods limit. See the official guide for solutions. Copied from the documentation:

Avoiding the 65K Limit

Before configuring your app to enable use of 65K or more method references, you should take steps to reduce the total number of references called by your app code, including methods defined by your app code or included libraries. The following strategies can help you avoid hitting the dex reference limit:

  • Review your app's direct and transitive dependencies - Ensure any large library dependency you include in your app is used in a manner that outweighs the amount of code being added to the application. A common anti-pattern is to include a very large library because a few utility methods were useful. Reducing your app code dependencies can often help you avoid the dex reference limit.
  • Remove unused code with ProGuard - Configure the ProGuard settings for your app to run ProGuard and ensure you have shrinking enabled for release builds. Enabling shrinking ensures you are not shipping unused code with your APKs.

Using these techniques can help you avoid the build configuration changes required to enable more method references in your app. These steps can also decrease the size of your APKs, which is particularly important for markets where bandwidth costs are high.

Upvotes: 1

Related Questions