Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8646] Android: Database: V8: Runtime error is occuring while launching the app.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2013-04-18T19:53:45.000+0000
Affected Version/sRelease 2.0.1, Release 3.1.0
Fix Version/s2013 Sprint 08 API, 2013 Sprint 08
ComponentsAndroid
Labelsapi, qe-and040912
ReporterShyam Bhadauria
AssigneePing Wang
Created2012-04-10T03:59:04.000+0000
Updated2017-03-29T20:55:14.000+0000

Description

On launching the app, a runtime error is displayed on android 2.2 . Snapshot of the same is attached. Steps to reproduce: 1) Create an app with code below and add speed.db file in the project(attached in the bug). 2) Install and launch the app.
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});
var label1 = Titanium.UI.createLabel({
			color : '#999',
			text : 'I am Window 1',
			font : {
				fontSize : 20,
				fontFamily : 'Helvetica Neue'
			},
			textAlign : 'center',
			width : 'auto'
		});

		var db = Titanium.Database.install('speed.db', 'myDB');

		win.add(label1);
		win.open();
		
Expected result : A window should be displayed : "I am window 1" Actual result : A runtime error is displayed. Note: It is showing expected behavior on android 3.2 and 4.0.2

Attachments

FileDateSize
DatabaseAndroid-2012-04-10-153559.png2012-04-10T03:59:04.000+000042571
DatabaseLog.txt2012-04-10T03:59:04.000+00001581
speed.db2012-04-10T03:59:04.000+00001802240

Comments

  1. Shyam Bhadauria 2012-04-10

    This bug is reproducible on Titanium SDK 1.8.2, 2.0
  2. jithinpv 2013-03-04

    it works only on android emulator Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Android Emulator: Android SDK version: 2.2
  3. jithinpv 2013-03-04

    Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4
  4. Ping Wang 2013-04-18

    Can reproduce the crash only on 2.2 devices with the log:
       D/asset   ( 2821): Data exceeds UNCOMPRESS_DATA_MAX (1802240 vs 1048576)
       E/TiDatabase( 2821): (KrollRuntimeThread) [5,3038] Error installing database: myDB msg=null
       E/TiDatabase( 2821): java.io.IOException
       E/TiDatabase( 2821): 	at android.content.res.AssetManager.readAsset(Native Method)
       E/TiDatabase( 2821): 	at android.content.res.AssetManager.access$700(AssetManager.java:36)
       E/TiDatabase( 2821): 	at android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:571)
       E/TiDatabase( 2821): 	at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:157)
       E/TiDatabase( 2821): 	at java.io.BufferedInputStream.read(BufferedInputStream.java:346)
       E/TiDatabase( 2821): 	at java.io.FilterInputStream.read(FilterInputStream.java:130)
       E/TiDatabase( 2821): 	at ti.modules.titanium.database.DatabaseModule.install(DatabaseModule.java:121)
       E/TiDatabase( 2821): 	at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
       E/TiDatabase( 2821): 	at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159)
       E/TiDatabase( 2821): 	at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)
       E/TiDatabase( 2821): 	at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185)
       E/TiDatabase( 2821): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/TiDatabase( 2821): 	at android.os.Looper.loop(Looper.java:123)
       E/TiDatabase( 2821): 	at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
       
    This is not a Titanium bug. It's a limitation on Android 2.2 that any compressed asset file with an uncompressed size of over 1 MB cannot be read from the APK. The workaround is renaming the .db file to .jpg. Here is some similar discussions: http://stackoverflow.com/questions/5789177/i-get-this-error-data-exceeds-uncompress-data-max-on-android-2-2-but-not-on-2-3 http://stackoverflow.com/questions/6438934/titanium-appcelarator-data-exceeds-uncompress-data-max-3964928-vs-1048576-in-a http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
  5. Lee Morris 2017-03-29

    Closing ticket as it has been established that the issue is not our bug.

JSON Source