Android Studio 2.3.3 - could not encode class bundle

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Mon Aug 21, 2017 5:01 am

Hi,
I saw where people were having this problem with earlier versions of Android SDK but I couldn't find anything regarding Studio 2.3.3. I'm getting the error when I send to the sim or build a standalone. The IOS version of my app builds fine.

I'm running:
LC 8.1.6, Indy
Java 8 Update 144
Studio 2.3.3

Here are my standalone settings:
Android Standalone Settings.png
Here are the SDK components I have loaded: Also 4.0.3 15
Android Studio_01.png
And the tools I have loaded:
Android Studio Tools_04.png
Any help would be appreciated.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Mon Aug 21, 2017 10:59 pm

You have to install a legacy version of Java for OS X, here:
https://support.apple.com/kb/dl1572?locale=en_US

Oracle's version 8 won't work. Restart LC after installation.

Edit: after installing, check the path in the mobile pane of LC prefs to be sure it's listed there next to "JDK Path:"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Mon Aug 21, 2017 11:52 pm

Hi Jacqueline,
Thanks for the help. Installed the legacy version.
Prefs Pnl.png
I must have done something wrong.
Still no joy.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Tue Aug 22, 2017 12:03 am

That's odd, my copy says Java 1.6.0. I got it from the link I posted. If I remember right, 1.6 is what we need to use but they've changed a lot of things since I first installed. I'm not using Android Studio, I'm still using the older Java app.

I assume you got all the installations mentioned in the LC lesson?
http://lessons.livecode.com/m/2571/l/62 ... -5-onwards

I don't know how Studio manages the files, but with the Java app I had to download the latest platform tools and build tools. I don't see those listed in the LC Studio lesson.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Tue Aug 22, 2017 12:19 am

Thanks Jacqueline. Yes, I have gone thru that lesson. Everything I've read says to install Java 8 144 for Studio
Guess I'll keep poking a this.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Tue Aug 22, 2017 12:42 am

I know and either they've changed things or it's wrong. It's been incorrect before when providing the link to Oracle's site, which didn't work in the past, but I think we need verification from the team.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Tue Aug 22, 2017 1:16 am

I hear you! This is why I've avoided converting any of my apps to Android. Just thought I'd give it another go because I want to convert my latest project. Thought the kinks would have been worked out by now.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Tue Aug 22, 2017 2:37 am

Do you feel like asking tech support to verify their lesson content? It would help a lot of people.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Tue Aug 22, 2017 2:40 am

Great idea. I'll ping them and once I get this figured out I'll post the results. Thanks again, J.
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Tue Aug 22, 2017 9:25 pm

A quick update.

Studio does require Java 8 144. The problem I was having was that there was a previous Java folder in the Library folder and even though I have admin on my machine, the Java 8 144 install wasn't added to the existing folder. I renamed the existing folder and re-installed Java 8 144 and it build a new folder with the correct Java level in it. That fixed the Java problem. I don't get "could not encode class bundle" anymore.

Now I get this. But I'm thinking it's just the way I have the VM configured... I hope.
New error.png
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Tue Aug 22, 2017 9:39 pm

It sounds like the EABI image wasn't downloaded and installed, or you didn't choose it as the VM. Glad you got it fixed.

I've just moved to a new Mac and got the same "class bundle" error. I fixed it by installing the 1.6 Apple version of Java and getting an old copy of the Android tools from a backup. There's a warning in this lesson about not using the latest build tools, which I'd accidentally updated before seeing it:

http://lessons.livecode.com/m/4069/l/56 ... r-on-a-mac

One of these days I may move to Android Studio, though really all we need to have for LC builds are the command line tools.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Tue Aug 22, 2017 10:33 pm

Sorry for showing my ignorance once again. What's EABI image? Is that something in the AVD manager?
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Tue Aug 22, 2017 10:51 pm

It's one of the virtual images Android supplies as a template for setting up a VM. I'm not sure how Studio does it though. It shows up in my Java app in every version of the OS with an option to install. Sorry I can't help more, I'm still too old school.
Attachments
Screen Shot 2017-08-22 at 4.47.13 PM.png
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android Studio 2.3.3 - could not encode class bundle

Post by quailcreek » Wed Aug 23, 2017 1:40 am

Looks like there are some files missing in Studio 2.3.3 under Android 8

I loaded 7.1.1 and created a VM using it. Sending to the sim gave the same result. I've asked Elanor to explain how she set up her VM. I'll post back when she replies.
EABI.png
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio 2.3.3 - could not encode class bundle

Post by jacque » Wed Aug 23, 2017 6:12 am

Looking at my list, the last copy of the system image is in Android 7.0 (API 24), named "ARM EABI v7a System Image". Presumably that one is shared by newer versions, but I can only guess. I haven't used a VM in some years, they're slow and dodgy and not really worth the trouble. It's way easier to cable your device to the Mac and just use the Test button in the IDE. Faster too.

Even building an APK standalone and transferring it to your device via Dropbox is faster.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”