55102

Android ICS version building contacts code on eclipse

I am trying to build ICS contacts code on eclipse. As contacts was using some hidden classes, I created a new jar file with all the required classes and was successful in building the apk.

But now the problem is the classes whichever I added in the jar are missing links in the final apk package and I am getting noClassDefFoundError exception.

I decompiled the apk and found that class was present in the apk. Why the link is missing eventhough class file is present in the apk?

I tried using the jar file as an external library but because of its size (>20mb) was not successful.

Answer1:

The Contacts app is using several types of hidden files. Some of them are hidden framework items, like AggregationSuggestions.PARAMETER_MATCH_NAME, and others belongs to the static libraries like com.android.phone.CallLogAsync. First kind of files should never be embedded into your APK, but the second should be.

If you look into Android.mk for the Contacts you can figure out what static libraries are needed:

LOCAL_STATIC_JAVA_LIBRARIES := \ com.android.phone.common \ com.android.vcard \ android-common \ guava \ android-support-v13 \ android-support-v4 \ android-ex-variablespeed \

To compile Contact in eclipse you should add framework classes as "User library" and all static libraries as "External JAR".

The easiest way to obtain all needed jars is to build Android sources and look into out/target/common/obj/JAVA_LIBRARIES. Each library has its own directory named libname_intermediates with classes-full-debug.jar in it. These jars are exactly what you need to build Contacts. Framework classes reside in framework_intermediates, however you may need to add some more jars.

You should adjust "Order & Export" for your project in Eclipse to make sure that your "User Library" with framework classes is above of "Android 4.0".

Recommend

  • why AES encryption is faster than Decryption
  • Nodejs res.render function not updating html page
  • decompile a .class file programmatically
  • How do you remove old version of entity framework in GAC?
  • Attach .java file as source for .jar in IntelliJ?
  • How to add JNI hooks to one jar generated by Spring Boot
  • Weird pattern match issue
  • Formatting of number from contacts
  • Sitecore 8: Number of Recipients in List Manager not calculating properly
  • updating and compacting sqlite database in android
  • How to Upload a file in GWT
  • App Memory Usage differs between Devices
  • Netezza Incremental load from Sql server using SSIS
  • LNK1104: cannot open file 'kernel32.lib'
  • What is the equivalent of Android permissions in iOS development? [duplicate]
  • Passing information to server-side function in a Google Docs Add On
  • What's the syntax to inherit documentation from another indexer?
  • Retrieving specified columns from a list of csv files to create a data data frame in R
  • Is there a way to do normal logging with EureakLog?
  • Combining SpatialPolygonsDataFrame of two neighbour countries
  • MailKit: The IMAP server replied to the 'EXAMINE' command with a 'BAD' response
  • Change multiple background-images with jQuery
  • How to delay loading a property with linq to sql external mapping?
  • Is there any way to access browser form field suggestions from JavaScript?
  • Android screen density dpi vs ppi
  • req.body is undefined - nodejs
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Change an a tag attribute in JavaScript based on screen width
  • Symfony2: How to get request parameter
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • jQuery tmpl and DataLink beta
  • Why winpcap requires both .lib and .dll to run?
  • Akka Routing: Reply's send to router ends up as dead letters
  • Is there a mandatory requirement to switch app.yaml?
  • Java static initializers and reflection
  • unknown Exception android
  • reshape alternating columns in less time and using less memory
  • Observable and ngFor in Angular 2
  • Unable to use reactive element in my shiny app