diff --git a/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp b/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp
index 30b72bb..317710c 100644
--- a/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp
+++ b/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp
@@ -82,14 +82,12 @@
 }
 
 bool TerminalPositionLookupTable::runGCTerminalIds(TerminalIdMap *const terminalIdMap) {
-    int removedEntryCount = 0;
     int nextNewTerminalId = 0;
     for (int i = 0; i < mSize; ++i) {
         const int terminalPos = getBuffer()->readUint(
                 Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE, getEntryPos(i));
         if (terminalPos == Ver4DictConstants::NOT_A_TERMINAL_ADDRESS) {
             // This entry is a garbage.
-            removedEntryCount++;
         } else {
             // Give a new terminal id to the entry.
             if (!getWritableBuffer()->writeUint(terminalPos,
diff --git a/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp b/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp
index 5503151..e4d7c2d 100644
--- a/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp
+++ b/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp
@@ -71,14 +71,12 @@
 }
 
 bool TerminalPositionLookupTable::runGCTerminalIds(TerminalIdMap *const terminalIdMap) {
-    int removedEntryCount = 0;
     int nextNewTerminalId = 0;
     for (int i = 0; i < mSize; ++i) {
         const int terminalPos = getBuffer()->readUint(
                 Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE, getEntryPos(i));
         if (terminalPos == Ver4DictConstants::NOT_A_TERMINAL_ADDRESS) {
             // This entry is a garbage.
-            removedEntryCount++;
         } else {
             // Give a new terminal id to the entry.
             if (!getWritableBuffer()->writeUint(terminalPos,
diff --git a/native/jni/src/dictionary/utils/trie_map.cpp b/native/jni/src/dictionary/utils/trie_map.cpp
index 0bef8c7..19ad9c5 100644
--- a/native/jni/src/dictionary/utils/trie_map.cpp
+++ b/native/jni/src/dictionary/utils/trie_map.cpp
@@ -53,7 +53,7 @@
     for (int i = from; i < to; ++i) {
         AKLOGI("Entry[%d]: %x, %x", i, readField0(i), readField1(i));
     }
-    int unusedRegionSize = 0;
+    [[maybe_unused]] int unusedRegionSize = 0;
     for (int i = 1; i <= MAX_NUM_OF_ENTRIES_IN_ONE_LEVEL; ++i) {
         int index = readEmptyTableLink(i);
         while (index != ROOT_BITMAP_ENTRY_INDEX) {
diff --git a/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp b/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
index 0aeb36a..0aa6caf 100644
--- a/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
+++ b/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
@@ -490,12 +490,10 @@
     const int x0 = (*sampledInputXs)[id];
     const int y0 = (*sampledInputYs)[id];
     const int actualInputIndex = (*sampledInputIndices)[id];
-    int tempTime = 0;
     int tempBeelineDistance = 0;
     int start = actualInputIndex;
     // lookup forward
     while (start > 0 && tempBeelineDistance < lookupRadius) {
-        tempTime += times[start] - times[start - 1];
         --start;
         tempBeelineDistance = GeometryUtils::getDistanceInt(x0, y0, xCoordinates[start],
                 yCoordinates[start]);
@@ -504,12 +502,10 @@
     if (start > 0 && start < actualInputIndex) {
         ++start;
     }
-    tempTime= 0;
     tempBeelineDistance = 0;
     int end = actualInputIndex;
     // lookup backward
     while (end < (inputSize - 1) && tempBeelineDistance < lookupRadius) {
-        tempTime += times[end + 1] - times[end];
         ++end;
         tempBeelineDistance = GeometryUtils::getDistanceInt(x0, y0, xCoordinates[end],
                 yCoordinates[end]);
diff --git a/native/jni/src/suggest/core/layout/proximity_info_utils.h b/native/jni/src/suggest/core/layout/proximity_info_utils.h
index 79d0615..0037961 100644
--- a/native/jni/src/suggest/core/layout/proximity_info_utils.h
+++ b/native/jni/src/suggest/core/layout/proximity_info_utils.h
@@ -72,7 +72,7 @@
             for (int i = 0; i < inputSize; ++i) {
                 AKLOGI("---");
                 for (int j = 0; j < MAX_PROXIMITY_CHARS_SIZE; ++j) {
-                    int proximityChar =
+                    [[maybe_unused]] int proximityChar =
                             inputProximities[i * MAX_PROXIMITY_CHARS_SIZE + j];
                     proximityChar += 0;
                     AKLOGI("--- (%d)%c", i, proximityChar);
diff --git a/native/jni/src/suggest/core/result/suggestion_results.cpp b/native/jni/src/suggest/core/result/suggestion_results.cpp
index 3756d10..312c9e7 100644
--- a/native/jni/src/suggest/core/result/suggestion_results.cpp
+++ b/native/jni/src/suggest/core/result/suggestion_results.cpp
@@ -97,7 +97,7 @@
         suggestedWords.push_back(copyOfSuggestedWords.top());
         copyOfSuggestedWords.pop();
     }
-    int index = 0;
+    [[maybe_unused]] int index = 0;
     for (auto it = suggestedWords.rbegin(); it != suggestedWords.rend(); ++it) {
         DUMP_SUGGESTION(it->getCodePoint(), it->getCodePointCount(), index, it->getScore());
         index++;
