Page 1 of 3
Android Studio 2.3.3 - could not encode class bundle
Posted: Mon Aug 21, 2017 5:01 am
by quailcreek
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:
Here are the SDK components I have loaded: Also 4.0.3 15
And the tools I have loaded:
Any help would be appreciated.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Mon Aug 21, 2017 10:59 pm
by jacque
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:"
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Mon Aug 21, 2017 11:52 pm
by quailcreek
Hi Jacqueline,
Thanks for the help. Installed the legacy version.
I must have done something wrong.
Still no joy.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 12:03 am
by jacque
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 12:19 am
by quailcreek
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 12:42 am
by jacque
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 1:16 am
by quailcreek
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 2:37 am
by jacque
Do you feel like asking tech support to verify their lesson content? It would help a lot of people.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 2:40 am
by quailcreek
Great idea. I'll ping them and once I get this figured out I'll post the results. Thanks again, J.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 9:25 pm
by quailcreek
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 9:39 pm
by jacque
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 10:33 pm
by quailcreek
Sorry for showing my ignorance once again. What's EABI image? Is that something in the AVD manager?
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Tue Aug 22, 2017 10:51 pm
by jacque
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Wed Aug 23, 2017 1:40 am
by quailcreek
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.
Re: Android Studio 2.3.3 - could not encode class bundle
Posted: Wed Aug 23, 2017 6:12 am
by jacque
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.