2013-08-26 170 views
0

我使用鈦3.1.0 GA。該應用程序通常運行良好。但有時啓動時,它崩潰在實際設備上隨意的場合。以下是崩潰的截圖:鈦隨機程序崩潰在啓動

enter image description here

這似乎並不在我的應用程序中的問題,因爲大多數時候和任何可能出現的情況,應用程序啓動的罰款。但有時在同一臺設備上會出現問題。但我仍顯示我的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 [email protected] (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[email protected]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

它不是一個隨機creash可能你正在嘗試訪問功能,這不是一個實際的功能 –

+1

plz在這裏分享您的代碼 –

+0

@Wahhab_mirza我已經添加了我的代碼。請再看一下 –

回答

0

我猜測(只是猜測),它有事情做與您所請求的意圖。試一下,看看如果出現這種情況,如果有意向(如果沒有)。

我會做的是在每行之後寫的編號爲「信息」到控制檯,看看在飛機墜毀前的最後一個號碼發生。該號碼後的線是有問題的一個。