title: Facebook native SDK conflicts with Parse4CN1 on Android
body: <p>I'm currently having some trouble with an issue that was previously fixed through a build hint some time ago as you can see in the following thread: </p>
  
  <p><a href="https://groups.google.com/forum/#!searchin/codenameone-discussions/parse4cn1%7Csort:date/codenameone-discussions/4xipU9Sy5rY/IbX1YMmGBQAJ" rel="nofollow noreferrer">https://groups.google.com/forum/#!searchin/codenameone-discussions/parse4cn1%7Csort:date/codenameone-discussions/4xipU9Sy5rY/IbX1YMmGBQAJ</a></p>
  
  <pre><code>I'm still keeping the build hint android.excludeBolts=true as well as the facebook.appId build hint set to my app id, but it now fails with the following error:
  
  2019-03-19 00:35:44.832 9571-9571/? E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.guarumo.ego, PID: 9571
      java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/AppLinks;
          at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
          at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155)
          at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101)
          at android.app.Application.dispatchActivityCreated(Application.java:208)
          at android.app.Activity.onCreate(Activity.java:1110)
          at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306)
          at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53)
          at android.app.Activity.performCreate(Activity.java:7383)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
          at android.app.ActivityThread.-wrap12(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
          at android.os.Handler.dispatchMessage(Handler.java:108)
          at android.os.Looper.loop(Looper.java:166)
          at android.app.ActivityThread.main(ActivityThread.java:7529)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
       Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.AppLinks" on path: DexPathList[[zip file "/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131) 
          at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155) 
          at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101) 
          at android.app.Application.dispatchActivityCreated(Application.java:208) 
          at android.app.Activity.onCreate(Activity.java:1110) 
          at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306) 
          at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53) 
          at android.app.Activity.performCreate(Activity.java:7383) 
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218) 
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256) 
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411) 
          at android.app.ActivityThread.-wrap12(Unknown Source:0) 
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994) 
          at android.os.Handler.dispatchMessage(Handler.java:108) 
          at android.os.Looper.loop(Looper.java:166) 
          at android.app.ActivityThread.main(ActivityThread.java:7529) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 
  </code></pre>
  
  <p>On the other hand, if I set the android.excludeBolts build hint to false I get the problem presented on the previously mentioned thread:</p>
  
  <pre><code>Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AggregateException;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$1;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$UIThreadExecutor;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$1;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$ImmediateExecutor;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationToken;
  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationTokenRegistration;
  Dex: Error converting bytecode to dex:
  Cause: java.lang.RuntimeException: Translation has been interrupted
      UNEXPECTED TOP-LEVEL EXCEPTION:
      java.lang.RuntimeException: Translation has been interrupted
          at com.android.dx.command.dexer.Main.processAllFiles(Main.java:615)
          at com.android.dx.command.dexer.Main.runMonoDex(Main.java:313)
          at com.android.dx.command.dexer.Main.runDx(Main.java:291)
          at com.android.dx.command.dexer.Main.main(Main.java:247)
          at com.android.dx.command.Main.main(Main.java:94)
      Caused by: java.lang.InterruptedException: Too many errors
          at com.android.dx.command.dexer.Main.processAllFiles(Main.java:607)
          ... 4 more
  
  :transformClassesWithDexForRelease FAILED
  :transformClassesWithDexForRelease (Thread[Daemon worker,5,main]) completed. Took 22.043 secs.
  </code></pre>
  
  <p>I think this might be being caused by the change to a newer version of the Facebook SDK, but couldn't confirm it. Could you please help me out with this problem?</p>
  
  <p>Thanks in advance.</p>