Last Updated on 2025-11-22 by william
我這 APP 很奇葩,用 git shallow 減少 clone 下載版本量呢。
2011年第一隻 android app 有數萬下載量,2019年我又練習寫了一個「GIT文字筆記」,是個”麻瓜勿擾的APP”。
GIT文字筆記
1. 利用 github 來協助寫筆記,其 git commit 功能,能有效紀錄我 “為何” 修改內容,並且做好版本控管。
2. 可以離線使用,等有網路再同步回 github。
3. 筆記使用純文字,附檔依附在改文字檔案目錄底下,這種方式可以避免 app 不能使用時,還能在其他平台同步回來使用,相容度極高。


2025/11/22
為了要符合 android 15 版的規範,解決無邊框問題,我修改了程式,但出現了一個新問題
java.lang.NullPointerException: Inflater has been closed
這問題發生在重新 git clone 的指令,被當作異常導致程式無法繼續複製 github 的 repository 到手機上。我爬了文,解釋如下:
In Android, close() ends the inflater all the time. https://chromium.googlesource.com/android_tools/+/refs/heads/master/sdk/sources/android-25/java/util/zip/InflaterInputStream.java#229
In non-Android it only closes if it is created within the InflaterInputStream. https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/zip/InflaterInputStream.java#L226
Since we reuse the Inflater here and closes the InflaterInputStream here, it behaves differently on Android.
I will have to think about how to fix this.

實際上這錯誤不會造成影響,我修改了自己的 library 排除此錯誤,重新測試 git clone 功能,一切都正常了。
另外我使用 eclipst 的 git 函式庫,編譯時出現一個問題,解法如下
android {
packaging {
resources.excludes.add('OSGI-INF/l10n/*')
resources.pickFirsts.add('OSGI-INF/l10n/*')
}
} 
搶先發佈留言