I get the error No implementation found for native Ldalvik/system/VMRuntime;.pauseGc , below is logCat.
05-13 22:39:22.538: W/dalvikvm(8350): No implementation found for native Ldalvik/system/VMRuntime;.pauseGc:(Ljava/lang/String;)I 05-13 22:39:22.543: E/MyThread(8350): Pause GC 05-13 22:39:22.543: E/MyThread(8350): java.lang.reflect.InvocationTargetException 05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invokeNative(Native Method) 05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invoke(Method.java:515) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.pauseGC(MyThread.java:5525) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.performLaunchActivity(MyThread.java:2324) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.handleLaunchActivity(MyThread.java:2471) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.access$900(MyThread.java:175) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread$H.handleMessage(MyThread.java:1308) 05-13 22:39:22.543: E/MyThread(8350): at android.os.Handler.dispatchMessage(Handler.java:102) 05-13 22:39:22.543: E/MyThread(8350): at android.os.Looper.loop(Looper.java:146) 05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.main(MyThread.java:5602) 05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invokeNative(Native Method) 05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invoke(Method.java:515) 05-13 22:39:22.543: E/MyThread(8350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) 05-13 22:39:22.543: E/MyThread(8350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) 05-13 22:39:22.543: E/MyThread(8350): at dalvik.system.NativeStart.main(Native Method) 05-13 22:39:22.543: E/MyThread(8350): Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dalvik.system.VMRuntime.pauseGc:(Ljava/lang/String;)I 05-13 22:39:22.543: E/MyThread(8350): at dalvik.system.VMRuntime.pauseGc(Native Method) 05-13 22:39:22.543: E/MyThread(8350): ... 15 more
I searched on different forums, but this error is related to Samsung 4.4.2 and higher updates for a subset of notes (I have two Note devices with the same specifications, and this error only occurs on one of them)
The idea here is to know what exactly causes this error, so that I can change the course of my program to avoid the conditions under which this error can occur. The most requested or official response is most in demand, and I will become 200 bounty on this issue as soon as I get the right to participate.
In my case, this happens when I perform an intensive memory operation. My knowledge (however possible) tells me that it has something to do with pausing the GC, will cause (manual) things to solve for System.gc for me?
How to recover this error? In my loop, I read from one DB table, address book and file one by one. These read values ββgo through the calculation process, and the results are stored in a larger database. These statements are in a while loop, I set the checks in a try catch so that if any and not limited to this error occurs. I start with the next iteration of the loop, using the continue statement in the catch clause - neglecting the record where the failure occurs. However, execution is not guaranteed using this method, as the failure may continue, causing subsequent entries to be omitted.
Edit: here is the code lock code:
if(FLAG ==1){ toRead=new File(getApplicationContext().getFilesDir()+"/Reminders/fileone.txt"); }else{ toRead=new File(getApplicationContext().getFilesDir()+"/Reminders/output.txt"); } // copyDirectoryOneLocationToAnotherLocation(new File(getApplicationContext().getFilesDir()+"/Reminders/output.txt"), new File("mnt/sdcard/filecheck.txt")); FileInputStream fis=new FileInputStream(toRead); Scanner sc=new Scanner(fis); String currentLine; while(sc.hasNextLine()){ try{ System.out.println("count in file"+i); currentLine=sc.nextLine(); // TODO = gets concatnated StringTokenizer st=new StringTokenizer(currentLine,"=",false); CONTACT_NAME = toTitleCase(st.nextToken()); if(CONTACT_NAME.contains("'")){ CONTACT_NAME = CONTACT_NAME.replace("'", ""); } // ********* String listStr = st.nextToken(); String cut = listStr.substring(1, listStr.length() - 1); String[] array = cut.split(","); // System.out.println("Array is: "+Arrays.toString(array)); CONTACT_ID = (array[0].trim()); String dateStr = (array[1].trim()); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date date = format.parse(dateStr); java.sql.Date dx = new java.sql.Date(date.getTime()); Date key = dx; dateToInsert = String.valueOf(dx); CONTACT_IMAGE_URI = (array[2].trim()); if(CONTACT_IMAGE_URI.contains("?typ")){ CONTACT_IMAGE_URI = CONTACT_IMAGE_URI+"e=normal"; } if (isCancelled()) { break; } progress = ("" + Character.toUpperCase(CONTACT_NAME.charAt(0)) + CONTACT_NAME.substring(1) + "\n"+i + " of " + lines + " Contacts"); // Progress displayed here. years = getDiffYear(key); // For years elapsed secon = seconds(key); // for seconds elapsed min = seconds(key) / 60; // For minutes elapsed hours = getDiffHour(key);// For hours elapsed mon = months(String.valueOf(key)); // for months elapsed days = daysElapsed(key); // Days elapsed weeks = daysElapsed(key) / 7; // For weeks //=============================================================================================================== if (dateToInsert.contains("0001-") == true){ //Special Case, we added 0001 to Birthdays Which Have NO Year field. //=========================================================================================================== dbHelper.insert(dateToInsert, CONTACT_NAME, "","", CONTACT_IMAGE_URI, "", "", "", CONTACT_ID, "", "","1"); // All other fields will be empty, because we don't have a Year. int PRIMARY_ID = dbHelper.getPrimaryId(); String FOREIGN_KEY = dbHelper.getHighestID(PRIMARY_ID); //===================================================================================================== //In this case we are only interested in fetching the year alert for next birthday of this contact --> //===================================================================================================== intCal.yearsToNotify(years, dateToInsert); int yearsSpecial = intCal.getYearsRegular(); Date dateYearsReg = intCal.getYearsRegDate(); dbHelper.insertNotifications(5, convertDate(dateYearsReg), 0, yearsSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); } //========================================================================= //Case when all the Date fields exist and we set up notifications ---> //========================================================================= else if(dateToInsert != "null" && dateToInsert.contains("0001-") != true){ dbHelper.insert(dateToInsert, CONTACT_NAME, String.valueOf(days), String.valueOf(hours), CONTACT_IMAGE_URI, String.valueOf(min),String.valueOf(mon), String.valueOf(secon), CONTACT_ID, String.valueOf(weeks), String.valueOf(years),"1"); int PRIMARY_ID = dbHelper.getPrimaryId(); // Fetch the PrimaryId (_id) of the above inserted row, its the Foreign key for Notification and SpecialNotifications Table. String FOREIGN_KEY = dbHelper.getHighestID(PRIMARY_ID); // Same as above, but fetches the Name field of the last inserted row. //========================================================================= //**Database Insertions Notifications Table/ SpecialNotifications Table** //========================================================================= //=======================================================================================// //Regular intervals DB Insertions: //======================================================================================// //Notification Types: //1 for months //2 for weeks //3 for days //4 for minutes //5 for years //6 for seconds //7 for hours //======================================================================================// //============================== //For Months //============================== intCal.monthsNotify(mon, dateToInsert); int monSpecial = intCal.getMonthRegular(); Date dateMonReg = intCal.getMonRegDate(); dbHelper.insertNotifications(1, convertDate(dateMonReg), 0, monSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //=============================== //For Weeks //=============================== intCal.weeksToNotify(weeks,dateToInsert); int weekSpecial = intCal.getWeekRegular(); Date dateWeekReg =intCal.getWeekRegDate(); dbHelper.insertNotifications(2, convertDate(dateWeekReg), 0, weekSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //=============================== //For Days //=============================== intCal.daysToNotify(days, dateToInsert); int daysSpecial= intCal.getDaysRegular(); Date dateDaysReg = intCal.getDaysRegDate(); dbHelper.insertNotifications(3, convertDate(dateDaysReg), 0, daysSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //=============================== //For minutes //=============================== intCal.minutesToNotify(min,dateToInsert); long minutesSpecial= intCal.getMinutesRegular(); Date dateMinsReg = intCal.getMinutesRegDate(); dbHelper.insertNotifications(4, convertDate(dateMinsReg), 0,(int) minutesSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //============================== //For Years //============================== intCal.yearsToNotify(years, dateToInsert); int yearsSpecial = intCal.getYearsRegular(); Date dateYearsReg = intCal.getYearsRegDate(); dbHelper.insertNotifications(5, convertDate(dateYearsReg), 0, yearsSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //============================= //For Seconds //============================= intCal.secondsToNotify(secon, dateToInsert); long secondsSpecial= intCal.getSecondsRegular(); Date dateSecondsReg = intCal.getSecondsRegDate(); dbHelper.insertNotifications(6, convertDate(dateSecondsReg), 0, secondsSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //============================= //For Hours //============================= intCal.hoursToNotify(hours, dateToInsert); int hoursSpecial= intCal.getHoursRegular(); Date dateHoursReg= intCal.getHoursRegDate(); dbHelper.insertNotifications(7, convertDate(dateHoursReg), 0, hoursSpecial,FOREIGN_KEY,PRIMARY_ID,CONTACT_IMAGE_URI,dateToInsert ); //============================================================================================// //Special Intervals //============================================================================================// //Notification Types: //1 for months //2 for weeks //3 for days //4 for minutes //5 for years //6 for seconds //7 for hours //For Years intCal.specialIntervalYears(years, dateToInsert); int yearsOnceSpecial =intCal.getYearsSpecial(); Date dateYearsSpecial = intCal.getYearsSpDate(); dbHelper.insertSpecialNotifications(5, convertDate(dateYearsSpecial), yearsOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Months intCal.specialIntervalMonths(mon,dateToInsert); int monthsOnceSpecial= intCal.getMonthsSpecial(); Date dateMonthsSpecial = intCal.getMonthsSpDate(); dbHelper.insertSpecialNotifications(1, convertDate(dateMonthsSpecial), monthsOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Weeks intCal.specialIntervalsWeeks(weeks,dateToInsert); int weeksOnceSpecial= intCal.getWeeksSpecial(); Date dateWeeksSpecial = intCal.getWeeksSpDate(); dbHelper.insertSpecialNotifications(2, convertDate(dateWeeksSpecial), weeksOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Days intCal.specialIntervalsDays(days, dateToInsert); int daysOnceSpecial= intCal.getDaysSpecial(); Date dateDaysSpecial = intCal.getDaysSpDate(); dbHelper.insertSpecialNotifications(3, convertDate(dateDaysSpecial), daysOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Hours intCal.specialIntervalsHours(hours,dateToInsert); int hoursOnceSpecial= intCal.getHoursSpecial(); Date dateHoursSpecial = intCal.getHoursSpDate(); dbHelper.insertSpecialNotifications(7, convertDate(dateHoursSpecial), hoursOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Minutes intCal.specialIntervalMinutes(min,dateToInsert); long minutesOnceSpecial= intCal.getMinutesSpecial(); Date dateMinutesSpecial= intCal.getMinutesSpDate(); dbHelper.insertSpecialNotifications(4, convertDate(dateMinutesSpecial), (int)minutesOnceSpecial,FOREIGN_KEY,PRIMARY_ID); //For Seconds intCal.specialIntervalsSeconds(secon,dateToInsert); long secondsOnceSpecial= intCal.getSecondsSpecial(); Date dateSecondsSpecial= intCal.getSecondsSpDate(); dbHelper.insertSpecialNotifications(6, convertDate(dateSecondsSpecial), secondsOnceSpecial,FOREIGN_KEY,PRIMARY_ID); } publishProgress(progress); Asycdialog.setMax(lines); Asycdialog.incrementProgressBy(1); i++; }catch (Exception e){ System.out.println("From catch 4"+e); continue; } }
Edit 2:
I am doing the above process inside try catch, in which I use transactions to speed things up. I implemented these transaction fragments when I open the try block, where I start the transaction, and I complete them in the finally block and install them successfully in the same place.