C2Call App Library Error

0
Hi,
I am implementing C2Call Example for only Call purpose.
And I am also attach C2Call library to C2Call example.
But i have some problems regarding to this example:

When i run this example , it gives me error at compile time:

Unable to execute dex: method ID not in [0, 0xffff]: 65536
Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

Then, i lots of done googling for avoid this problem, and finally it gives me one solution.

Project has lots of methods, and jar files, so minimize unnecessary jar files and methods from project.

So, i can done this process, but in C2Call Library lots of jar files, and i required only for dial call jar files, please define me actually workful jar files for dial call.
Responses (17)
  • Accepted Answer

    Wednesday, August 20 2014, 01:46 PM - #Permalink
    0
    Answered by mail.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, February 05 2015, 07:38 AM - #Permalink
    0
    I'm having the same problem. I just need to call and recieve audio calls. Please suggest.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, February 05 2015, 08:18 AM - #Permalink
    0
    Hello infomobulous,

    the error is caused by a limitation of the Dalvik VM. This uses a (ridiculous) 16bit type to reference the methods and thus we have a limit of 65k of methods per dex file.
    If your project is very large or references some 3rd party libs (like our SDK) then this limit can easily be exceeded.

    So the solution is to shrink the number of methods in your dex. Our SDK (and its dependencies) uses has the following number of methods:

    2263 aws-android-sdk-1.6.0_pg.jar (used for media messages and profile pictures)
    7242 flurry_3.2.1_pg.jar (used for event tracking, advertising and the Offerwall)
    1177 gson-2.0.jar
    17591 lib-c2callsdk_pg.jar (This is the core of the C2Call SDK)
    9 lib_sc_extra.jar
    107 libsrc-androidlog.jar
    282 libsrc-c2callclient-android.jar
    146 libsrc-contactapi.jar
    26 libsrc-cpufeatures.jar
    254 libsrc-facebook-android.jar
    38 libsrc-nativeaudio.jar
    105 libsrc-nativecodecs.jar
    130 libsrc-nativertp.jar
    96 libsrc-nativevideo.jar
    8028 libsrc-sipapplet-android.jar
    3426 simple-xml-2.7.1.jar

    The first two (heavy libraries) aws-android-sdk-1.6.0_pg.jar and flurry_3.2.1_pg.jar, can be safely removed if you don't rely on those features (media messages, advertising, event tracking). The rest is essential.

    Beside that, here are some tips that helped us to deal with Android's stupid 64k/dex methods limit:
    - (Highly recommended as a first step!!)
    You may be able to shrink your code (or other libs like our SDK) by ProGuard - we had great success with that. E.g. the original AWS dependencies had 13024 methods and after removing unused classes/methods only 2263 remained.

    -Another option may be to move some code (also possible for libraries) into a additional dex files and load those at runtime. Here is a nice blog post how to do that:
    http://android-developers.blogspot.se/2011/07/custom-class-loading-in-dalvik.html

    - And if nothing helps then you may be able to do it like Facebook.
    ... but I have no experience with that.


    Regards,
    Tobias
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, April 02 2015, 09:35 AM - #Permalink
    0
    I'm having the same problem. I just need to C2Call for only one to one and group audio video Call purpose please suggest.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, April 02 2015, 11:58 AM - #Permalink
    0
    Hi,

    I'm having the same problem. I just need to C2Call for only one to one and group audio video Call purpose please suggest.


    if the last post does not help in your case then you may also use Android's quite new multidex feature:
    https://developer.android.com/tools/building/multidex.html

    In our tests this worked flawless. The "drawback" is that you have to use Gradle for building and I'm not sure if this is properly supported by Eclipse (ADT), yet. So I suspect that you will have to switch to Android Studio (I recommend that anyway). Our SDK also ships with an *.aar library that can easily be integrated into any Android Studio project - check the folder "android_studio".

    Regards,
    Tobias
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 06 2015, 06:45 AM - #Permalink
    0
    Hi,

    There are problem in android studio.

    Error:Execution failed for task ':vasugo:packageAllDebugClassesForMultiDex'.
    > java.util.zip.ZipException: duplicate entry: com/facebook/android/AsyncFacebookRunner$1.class


    my project using facebook sdk and c2call libarary also using facebook sdk.

    reply please.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 06 2015, 10:17 AM - #Permalink
    0
    Error:Execution failed for task ':vasugo:packageAllDebugClassesForMultiDex'.
    > java.util.zip.ZipException: duplicate entry: com/android/vending/billing/IInAppBillingService$Stub$Proxy.class
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 07 2015, 07:46 AM - #Permalink
    0
    Hi,

    Our Facebook SDK is outdated and will be dropped in the upcoming release. But same is yours, since the latest SDK does not have the class:
    com.facebook.android.AsyncFacebookRunner anymore.
    However if you want to use your version you can strip ours from the SDK. On Posix systems something like the following one-liner should do the trick:
    http://pastie.org/private/vkxtiatlw1hml9snjnq
    Please call that from the path [C2Call-SDK/android_studio/], then it will create the file /tmp/lib-c2callsdk.aar without our version of the Facebook SDK.
    Or you just use our version and remove yours, whatever you prefer.

    Also, our SDK already includes the file
    IInAppBillingService.aidl from /extras/google/play_billing/ (well, actually the generated class files from that aidl)
    So you should be save to remove yours (or strip ours, like above).

    Regards,
    Tobias

    Edited by tgreinert - 07.04.2015 07:48
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 07 2015, 12:23 PM - #Permalink
    0
    What package name pass in command to remove the IInAppBillingService.aidl from .aar file like facebook

    unzip -d /tmp/lib-c2callsdk lib-c2callsdk.aar && pushd . && cd /tmp && zip -d lib-c2callsdk/classes.jar "com/facebook/*" && cd lib-c2callsdk && zip -r ../lib-c2callsdk.aar * && popd


    reply please.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 08 2015, 09:57 AM - #Permalink
    0
    Error:Execution failed for task ':vasugo:packageAllDebugClassesForMultiDex'.
    > java.util.zip.ZipException: duplicate entry: com/android/vending/billing/IInAppBillingService$Stub$Proxy.class


    how to remove IInAppBillingService.aidl from lib-c2callsdk.aar

    reply please.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 08 2015, 10:16 AM - #Permalink
    0
    Hi,

    (...)
    how to remove IInAppBillingService.aidl from lib-c2callsdk.aar


    As mentioned, it is not the *.aidl file that you have to remove but the *.class file(s) that are generated from that file. However, if you look at the very first line (after comments) of that file you see:
    package com.android.vending.billing;

    That is the package and therefore the path of the generated *.class file. well actually you get three class files because of two nested classes:
    com/android/vending/billing/IInAppBillingService$Stub$Proxy.class
    com/android/vending/billing/IInAppBillingService$Stub.class
    com/android/vending/billing/IInAppBillingService.class

    So use the the command from my previous post (just change the path) to remove them from the archive.

    Regards,
    Tobias
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 08 2015, 12:23 PM - #Permalink
    0
    I am try this command but it is not work.

    unzip -d /tmp/lib-c2callsdk lib-c2callsdk.aar && pushd . && cd /tmp && zip -d lib-c2callsdk/classes.jar "com/android/vending/billing/" && cd lib-c2callsdk && zip -r ../lib-c2callsdk.aar * && popd

    please resend full command with change.

    reply please.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 08 2015, 12:40 PM - #Permalink
    0
    Hi,
    I am try this command but it is not work.


    Of course this does not work because the classes.jar does not contain the entry:
    com/android/vending/billing/

    ..., but "only":
    com/android/vending/billing/IInAppBillingService$Stub$Proxy.class
    com/android/vending/billing/IInAppBillingService$Stub.class
    com/android/vending/billing/IInAppBillingService.class

    please check the man page of zip and search for "--delete" (-d) for a better understanding and how to modify that script for future situations, thanks.

    The script should be:
    unzip -d /tmp/lib-c2callsdk lib-c2callsdk.aar && pushd . && cd /tmp && zip -d lib-c2callsdk/classes.jar "com/android/vending/billing/*" && cd lib-c2callsdk && zip -r ../lib-c2callsdk.aar * && popd


    Regards,
    Tobias
    The reply is currently minimized Show
  • Accepted Answer

    Friday, April 10 2015, 09:16 AM - #Permalink
    0
    My project work fine when i am no use c2call .aar file in my project but when add c2call .aar file in my project it give me the following error.
    I am using android studio and copy .aar file in libs folder and add dependencies like.

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile(name: 'lib-c2callsdk', ext: 'aar')
    compile files('libs/gcm.jar')
    compile files('libs/httpmime-4.2.5.jar')
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile 'joda-time:joda-time:2.7'
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.facebook.android:facebook-android-sdk:4.0.1'
    }

    E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener

    E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vasugo.androidapp/com.vasugo.androidapp.HomePage}: android.view.InflateException: Binary XML file line #24: Error inflating class android.support.v4.widget.SwipeRefreshLayout

    reply please.

    Edited by vTechy - 10.04.2015 09:17
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 29 2016, 02:16 PM - #Permalink
    0
    Error:Execution failed for task ':Lov:transformClassesWithJarMergingForDebug'.
    > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/facebook/android/Facebook.class


    Getting this error after adding c2call build.
    • Sanjay Chaudhary
      more than a month ago
      Please replay must.
    • Sanjay Chaudhary
      more than a month ago
      MY GRADIL.BUILD LIKE THIS


      buildscript {
      repositories {
      maven { url 'https://maven.fabric.io/public' }
      }

      dependencies {
      classpath 'io.fabric.tools:gradle:1.+'
      }
      }
      apply plugin: 'android'
      apply plugin: 'io.fabric'
      apply plugin: 'com.android.application'

      repositories {
      maven { url 'https://maven.fabric.io/public' }
      maven { url 'https://c2call.com/archiva/repository/release/' }
      }


      dependencies {
      compile fileTree(include: '*.jar', dir: 'libs')
      compile project(':EMOJITextView')
      compile project(':FacebookSDK')
      compile project(':RangeSeekBar-master')
      compile project(':wheel')
      compile project(':libraryStrickyHeader')
      compile project(':library_indicator')
      // compile project(':com-digits-sdk-android_digits_2')
      // compile project(':com-twitter-sdk-android_twitter-core_2')
      // compile project(':io-fabric-sdk-android_fabric_2')
      // compile project(':google-play-services_lib')
      compile project(':libraryImageloder')
      compile project(':library1')
      compile project(':slideuplib')
      // compile project(':SlidingUpPanelLibs')
      compile project(':FloatingActionButton')
      compile 'com.android.support:support-v4:19.0.0'
      compile('com.digits.sdk.android:digits:1.10.0@aar') {
      transitive = true;
      }

      compile 'com.c2call.android:c2callsdk:1.6.+'
      compile 'com.android.support:multidex:1.0.1'
      compile 'com.google.android.gms:play-services:4.2.42'



      // compile('com.facebook.android:facebook-android-sdk:4.8.2') {
      // exclude module: 'bolts-android'
      // }
      }

      allprojects {
      repositories {
      jcenter()
      }
      }

      android {
      compileSdkVersion 21
      buildToolsVersion "23.0.2"

      sourceSets {
      main {
      manifest.srcFile 'AndroidManifest.xml'
      java.srcDirs = ['src']
      resources.srcDirs = ['src']
      aidl.srcDirs = ['src']
      renderscript.srcDirs = ['src']
      res.srcDirs = ['res']
      assets.srcDirs = ['assets']
      }

      // Move the tests to tests/java, tests/res, etc...
      instrumentTest.setRoot('tests')

      // Move the build types to build-types/
      // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
      // This moves them out of them default location under src//... which would
      // conflict with src/ being used by the main source set.
      // Adding new build types or product flavors should be accompanied
      // by a similar customization.
      debug.setRoot('build-types/debug')
      release.setRoot('build-types/release')


      }

      defaultConfig {
      applicationId "com.oneclickit.lov"
      minSdkVersion 16
      targetSdkVersion 21
      multiDexEnabled true
      }

      buildTypes {
      release {
      minifyEnabled false
      multiDexEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
      }
      }



      }
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, April 02 2016, 06:44 AM - #Permalink
    0
    Hello All ,

    I find this bug in Android 6.0.1


    FATAL EXCEPTION: main
    Process: com.oneclickit.lov, PID: 5909
    java.lang.RuntimeException: Unable to create application com.oneclickit.lov.App: java.lang.SecurityException: getDeviceId: Neither user 10273 nor current process has android.permission.READ_PHONE_STATE.
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6324)
    at android.app.ActivityThread.access$1800(ActivityThread.java:222)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: java.lang.SecurityException: getDeviceId: Neither user 10273 nor current process has android.permission.READ_PHONE_STATE.
    at android.os.Parcel.readException(Parcel.java:1620)
    at android.os.Parcel.readException(Parcel.java:1573)
    at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5371)
    at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:812)
    at com.c2call.sdk.lib.p.g.l.c(SourceFile:167)
    at com.c2call.sdk.pub.core.C2CallSdk.globalInit(SourceFile:1140)
    at com.c2call.sdk.pub.core.C2CallSdk.init(SourceFile:224)
    at com.oneclickit.lov.App.onCreate(App.java:34)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6321)
    at android.app.ActivityThread.access$1800(ActivityThread.java:222) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:158) 
    at android.app.ActivityThread.main(ActivityThread.java:7229) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 04 2016, 07:06 AM - #Permalink
    0
    Hi Sanjay,

    next time please open a new thread for a new issue.

    Your SecurityException is not a bug but the result of a new permission design. In Android 6.0+ you have to explicitly ask the user to grant specific permissions before using it.

    So you have two options to solve this.
    1. Implement the new permission handling and ask the user to grant the permissions
    2. Set the targetSdkVersion in your build.gradle to 22 (or below)

    Regards,
    Tobias
    The reply is currently minimized Show
Your Reply

About us

C2Call GmbH leads the way in introducing next generation mobile and browser-based calling solutions for the computing cloud. FriendCaller for iOS and Android are built using C2Call SDK, and demonstrate the unique capabilities to establish a peer-to-peer connection with any mobile platform and with any Internet browser without prerequisite software installations. With the new C2Call SDK, developers would now be able to integrate features alike FriendCaller in their existing or new apps on mobile.