Constant string too long


I'm trying to package my latest Android app for distribution, I've never had problems till today. I'm using 1.8.2 and V8.

During packaging I get the following error:

[ERROR] Error(s) compiling generated Java code
[ERROR] C:\Documents and Settings\[User]\My Documents\Titanium Studio Workspace\[app]\build\android\gen\com\[name]\test\ constant string too long

assets.put("app.js", "then 81,060 worth of alpha-numeric characters");

Anyone have any idea on how to resolve this problem?

— asked 4 years ago by Nicholas Thibault
  • I managed to get it working. Had to split some of my larger .js files into smaller chunks. I don't like having so many different files, so hopefully someone knows of a better fix.

    — commented 4 years ago by Nicholas Thibault
  • If it is not one thing, it is another. What I love about a bug like this, is that it doesn't hit you until you are exhausted from getting every last detail right and you're ready to submit to the Android Market/Google Play and BAM! sorry Charlie! You've got ANOTHER workaround and it always hits at some ungodly hour. In my case, I needed to do a production build to test Facebook integration and BAM! no way with 1.8.2 so I'm back to 1.8.1.

    BTW, I looked for about 20 minutes in JIRA and couldn't find anything so it doesn't appear that the developers know about this.

    — commented 4 years ago by Joe Falcone
  • HI Joe!

    As a workarround it may help if you set the property

    <property name="" type="bool">false</property>

    in tiapp.xml.

    The problem is the obfuscation code which was introduced in

    — commented 4 years ago by Dietrich Streifert
  • Great now it's work.

    — commented 4 years ago by Giuseppe Mastrangelo
  • So what are we losing by setting this property to false?

    — commented 4 years ago by Joe Falcone
  • Never do this!! this will put your apps.js to assets folder in apk file!!

    — commented 3 years ago by Okan ünverdi

3 Answers