Android Build error

113 views
Skip to first unread message

Mario Barón

unread,
Jul 24, 2017, 10:18:48 AM7/24/17
to CodenameOne Discussions
Hi guys,

I'm getting an error when trying to build an Android app, it has nothing out of the ordinary but the Facebook sdk for log in (by setting the app id as a build hint) and the use of the parse4cn1 cn1lib. 

I attach the server log to this message for better understanding of the problem.


Thanks in advance.

android build error 24-07-2017.txt

Steve Hannah

unread,
Jul 24, 2017, 2:04:01 PM7/24/17
to codenameone...@googlegroups.com
Try adding android.multidex=true to build hints.

(Your app has reached the max number of methods.... it needs to use multidex).

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/cdb7bf29-2482-4016-acec-edddde73f0b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

Mario Barón

unread,
Jul 24, 2017, 4:51:39 PM7/24/17
to CodenameOne Discussions
Hi Steve,

thanks for your quick reply. I've added the build hint as you mentioned, but I'm still getting the same error (or at least it looks like it). I attach to this reply the latest server error log.
android build error 24-07-2017(2).txt

Steve Hannah

unread,
Jul 24, 2017, 5:26:42 PM7/24/17
to codenameone...@googlegroups.com
Are you still using ant builds for your Android builds?  I.e. to you have android.gradle=false in your build hints?

On Mon, Jul 24, 2017 at 1:51 PM, Mario Barón <mario...@gmail.com> wrote:
Hi Steve,

thanks for your quick reply. I've added the build hint as you mentioned, but I'm still getting the same error (or at least it looks like it). I attach to this reply the latest server error log.


On Monday, July 24, 2017 at 1:04:01 PM UTC-5, Steve Hannah wrote:
Try adding android.multidex=true to build hints.

(Your app has reached the max number of methods.... it needs to use multidex).

Steve
On Mon, Jul 24, 2017 at 7:18 AM, Mario Barón <mario...@gmail.com> wrote:
Hi guys,

I'm getting an error when trying to build an Android app, it has nothing out of the ordinary but the Facebook sdk for log in (by setting the app id as a build hint) and the use of the parse4cn1 cn1lib. 

I attach the server log to this message for better understanding of the problem.


Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

Mario Barón

unread,
Jul 24, 2017, 6:09:17 PM7/24/17
to CodenameOne Discussions
Hey Steve,


I had turned off gradle do to a fix I tried from something I saw on a nother post who had something similar but I just turned it on and I'm getting a different error now. I attach the new server error log to this reply.



On Monday, July 24, 2017 at 4:26:42 PM UTC-5, Steve Hannah wrote:
Are you still using ant builds for your Android builds?  I.e. to you have android.gradle=false in your build hints?
On Mon, Jul 24, 2017 at 1:51 PM, Mario Barón <mario...@gmail.com> wrote:
Hi Steve,

thanks for your quick reply. I've added the build hint as you mentioned, but I'm still getting the same error (or at least it looks like it). I attach to this reply the latest server error log.


On Monday, July 24, 2017 at 1:04:01 PM UTC-5, Steve Hannah wrote:
Try adding android.multidex=true to build hints.

(Your app has reached the max number of methods.... it needs to use multidex).

Steve
On Mon, Jul 24, 2017 at 7:18 AM, Mario Barón <mario...@gmail.com> wrote:
Hi guys,

I'm getting an error when trying to build an Android app, it has nothing out of the ordinary but the Facebook sdk for log in (by setting the app id as a build hint) and the use of the parse4cn1 cn1lib. 

I attach the server log to this message for better understanding of the problem.


Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/cdb7bf29-2482-4016-acec-edddde73f0b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/3acb2e86-4e35-4280-a95d-4cd14cc06696%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
android build error 24-07-2017(3).txt

Shai Almog

unread,
Jul 25, 2017, 12:53:57 AM7/25/17
to CodenameOne Discussions
Hi,
that seems to be a conflict between parse and the facebook login both of which include bolts. I'm not sure what's the "right thing" in this case. Maybe parse can offer a version specifically for working with Facebook Connect or maybe we will need to update something in the build.
Message has been deleted

Mario Barón

unread,
Jul 26, 2017, 12:00:35 PM7/26/17
to CodenameOne Discussions
Hi Shai,

thanks for your response. Could you please suggest anything I might be able to try out while this conflict is sorted out?


Thanks in advance.

Shai Almog

unread,
Jul 27, 2017, 1:17:37 AM7/27/17
to CodenameOne Discussions
I'm not sure. I suggest asking Chidi directly why this dependency exists in Parse and if he can remove it as an option.

Mario Barón

unread,
Sep 25, 2017, 3:25:37 PM9/25/17
to CodenameOne Discussions
Hey guys,

sorry for bringin this up again, but I haven't been able to solve this yet. I have found the following issue and solution that seems to solve the problem but I don't know how to include it into the CN1 Android project.

The solution seems to be simply to exclude the bolts library when compiling facebook and adding the missing artifacts like this:

compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile
'com.parse.bolts:bolts-applinks:1.3.0'

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

compile
'com.parse:parse-android:1.11.0'

How could I do this with Codename One? Thanks for your help.

Shai Almog

unread,
Sep 26, 2017, 12:21:23 AM9/26/17
to CodenameOne Discussions
Hi,
if you would use native facebook login how would you resolve this?

I would just forfeit the builtin facebook login support and try to integrate Facebook as a cn1lib in a way that doesn't conflict with parse. Moving forward I think implementing support for social networks as cn1libs is probably a better direction than the one we took

Mario Barón

unread,
Sep 29, 2017, 5:51:02 PM9/29/17
to CodenameOne Discussions
Hey guys!

I've managed to partially solve this conflict. I say partially because I had to download the compiled CN1 project's sources to do so but I've managed to build the app with both the Facebook login and parse4cn1 included. I'll walk you through my solution and let's see if you can help me automate the solution.

  1. I downloaded your parse4cn1.cn1lib file and opened it with winrar
  2. I accessed the nativeand.zip file and removed the bolts-tasks-1.4.0.jar file
  3. I took the parse4cn1.cn1lib file and put it in my lib folder on my codename one project and hit the refresh libs option.
  4. Compiled the app for Android
  5. Since I have a Pro account, I downloaded the project's native sources and opened the project with Android Studio.
  6. I added the bolts-tasks-1.4.0.jar back into the libs folder of the Android Project.
  7. I replaced the following dependency:
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    on the build.gradle file with the following:
    compile ('com.facebook.android:facebook-android-sdk:4.7.0'){ exclude module: 'bolts-android' }
  8. Clean and Rebuild the project and it's now running on my Android Device
This solution is working right now but it seems as this process could very possibly be automated in the build server so on the plugin side would just be like a build hint or something we could set up or something of that sort.

Please let me know what you think about this solutiong.

Thanks in advance!

Shai Almog

unread,
Sep 30, 2017, 12:47:12 AM9/30/17
to CodenameOne Discussions
Hi,
So if we add a build hint android.excludeBolts=true and generate code like you do in step 7 it should solve the whole thing?

Mario Barón

unread,
Oct 2, 2017, 10:18:50 AM10/2/17
to CodenameOne Discussions
Hi Shai,

sorry for the late reply, I was away this weekend with no internet connection.

Yeah, I guess it should just work with that. 

Thanks for your help and your quick reply! please let me know when this change would be available so I can give it a try!

Shai Almog

unread,
Oct 3, 2017, 12:14:20 AM10/3/17
to CodenameOne Discussions
Hi,
it will be up this Friday.
Reply all
Reply to author
Forward
0 new messages