1 < a href=’ '>Rerun</ a>
完整日誌是
Install failed.
Installation failed
< a href=' '>Rerun</ a>
產生這個問題是有很多原因的,具體看EventLog纔是關鍵
出現這個問題我的EventLog是這樣的:
Failed to commit install session 639684911 with command cmd package install-commit 639684911. Error: INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113
很明顯是ndk的依賴包出問題了。確實如此,gradle配置了armeabi-v7a和x86,而jniLibs中只添加了armeabi-v7a,再引入x86的包問題解決
2 is not accessible from
我遇到的異常詳情是
Caused by: java.lang.IllegalAccessException: java.lang.Class<com.fullcat.demo.b.MainActivity> is not accessible from java.lang.Class<android.app.Instrumentation>
是因爲寫MainActivity時候忘記加public了
3 Not allowed to bind to service Intent
在做aidl時出現的,是由於service標籤沒有添加
android:exported="true"
4 Unresolved reference
- 這個是在項目做組件化拆分是遇到的問題,是由於新module的gradle中忘記添加
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'
- kotlin項目提取公共的xml到base_module後,原module獲取不到該xml中view的id。
原因是由於kotlinx.android.synthetic.main是從當前的R文件中獲取id的,因此使用其他module中的xml時需要使用findViewById手動獲取
5 DataBinderMapperImpl
完整log是
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.databinding.DataBinderMapperImpl"
組件化項目轉化MVVM架構師遇到的,需要再每個module都添加
dataBinding {
enabled = true
}
6. error: resource android:attr/fontVariationSettings not found
把編譯版本由27改成28
7. This file can not be opened as a file descriptor; it is probably compressed
出現這個問題是加載 assets 中的一個.tflite文件的時候報的錯,這是因爲.lite文件被壓縮了,解決這個問題需要再gradle中添加如下代碼:
android {
...
aaptOptions {
noCompress "tflite" //表示不讓aapt壓縮的文件後綴
}
...
}
8. dlopen failed: cannot locate symbol “__aeabi_memcpy” referenced by
這個問題有點奇怪,是在我加載一個已經打好的.so庫是出現的,而該.so在其他項目中是OK的。額…不管引起的原因是啥,直接說解決方法吧。
我的 Application.mk 中有這樣一個語句:
APP_PLATFORM := android-8
但在我的ndk目錄下的 platforms 文件夾下並沒有android-8對應的版本號,將上面的語句改成platforms下存在的版本號即可。