我正在使用钛3.1.0 GA。该应用程序通常运行正常。但有时在发布时,它会在实际设备上随机崩溃。以下是崩溃的截图:
这在我的应用程序中似乎不是问题,因为大多数情况下并且在所有可能的情况下,应用程序启动都很好。但有时在同一台设备上会出现问题。但是我仍然会显示我的app.js文件代码,以防万一:
//bootstrap and check dependencies
if (Ti.version < 1.8)
{
alert('Sorry - this application template requires Titanium Mobile SDK 1.8 or later');
}
(function()
{
var Window = require('ui/common/HomeScreenWindow');
new Window().open();
var and = Ti.Android;
if(and)
{
var ca=and.currentActivity;
if(ca)
{
var intent=ca.getIntent();
if(intent.hasExtra("from_my_background_service"))
{
var cinemaName=intent.getStringExtra("cinemaName");
var cityName=intent.getStringExtra("cityName");
var moviesList=JSON.parse (intent.getStringExtra("moviesList"));
var MovieTimingWindow = require('ui/common/MoviesInTheatres');
new MovieTimingWindow(moviesList,cityName,cinemaName).open();
}
}
}
})();
我能够获得以下堆栈跟踪:
D/dalvikvm( 525): GC_FOR_ALLOC freed 1592K, 21% free 28277K/35648K, paused 90ms, total 90ms
W/InputMethodManagerService( 525): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@428c4c80 (uid=10076 pid=8393)
I/ActivityManager( 525): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=uk.co.planetbeyond.mobilinkmoviealerts/.Mobilink_chalo_cinemaActivity} from pid 842
D/dalvikvm( 525): GC_FOR_ALLOC freed 5603K, 23% free 23830K/30848K, paused 87ms, total 87ms
I/dalvikvm-heap( 525): Grow heap (frag case) to 27.987MB for 4915216-byte allocation
D/dalvikvm( 525): GC_FOR_ALLOC freed 1K, 20% free 28629K/35652K, paused 75ms, total 75ms
I/TiRootActivity( 8393): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
D/dalvikvm( 525): GC_CONCURRENT freed 1125K, 20% free 28626K/35652K, paused 6ms+9ms, total 128ms
E/TiExceptionHandler( 8393): (main) [94,94] ----- Titanium Javascript Runtime Error -----
E/TiExceptionHandler( 8393): (main) [0,94] - In ti:/titanium.js:139,10
E/TiExceptionHandler( 8393): (main) [0,94] - Message: Uncaught TypeError: undefined is not a function
E/TiExceptionHandler( 8393): (main) [0,94] - Source: return contextRequire(path, context, sourceUrl);
E/V8Exception( 8393): Exception occurred at ti:/titanium.js:139: Uncaught TypeError: undefined is not a function
V/PhoneStatusBar( 622): setLightsOn(true)
I/TiRootActivity( 8393): (main) [0,0] checkpoint, on root activity resume. activity = uk.co.planetbeyond.mobilinkmoviealerts.Mobilink_chalo_cinemaActivity@42472168
I/ActivityManager( 525): Displayed uk.co.planetbeyond.mobilinkmoviealerts/.Mobilink_chalo_cinemaActivity: +307ms
I/TiAnalyticsSvc( 8393): (Thread-3092) [29957,29957] Analytics Service Started
I/TiAnalyticsSvc( 8393): (Thread-3092) [2689,32646] Stopping Analytics Service
D/dalvikvm(26566): GC_CONCURRENT freed 545K, 6% free 10636K/11284K, paused 11ms+2ms, total 64ms
答案 0 :(得分:0)
我猜测(只是猜测)它与您请求的意图有关。如果有意图(如果没有),试着看看是否会发生这种情况。
我要做的是在每一行之后向控制台写一个带编号的'info',以查看崩溃发生前的最后一个数字。这个数字之后的那一行是有问题的。