[iOS]エラー対策 This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.

原文
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release

“[iOS]エラー対策 This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.” の続きを読む

[iOS]エラー対策 dyld: Library not loaded: @rpath/libswiftCore.dylib

実行時エラーです。

dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/00000000-0000-0000-0000-00000000000/AppName.app/AppName
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/00000000-0000-0000-0000-00000000000/AppName.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of ‘/private/var/mobile/Containers/Bundle/Application/00000000-0000-0000-0000-00000000000/AppName.app/Frameworks/libswiftCore.dylib’

Swiftの標準ライブラリがロードできない場合に発生するようです。

一般的な解決方法に、ちょっとだけ私の工夫を入れました。
以下の手順をお試しください。

1.Build Settings ー Build Options ー Embeedded Content Contains Swift Code をYESにする。
2.プロジェクトをクリーン
3.端末から既存のアプリを削除
4.ビルド&インストール

[Android]エラー対策 Method ‘methodname’ is too complex to analyze by data flow algorithm

Method ‘methodname’ is too complex to analyze by data flow algorithm

“[Android]エラー対策 Method ‘methodname’ is too complex to analyze by data flow algorithm” の続きを読む

[Android]エラー対策 Using setJavaScriptEnabled can introduce XSS vulnerabilities into you application, review carefully.

Using setJavaScriptEnabled can introduce XSS vulnerabilities into you application, review carefully.

“[Android]エラー対策 Using setJavaScriptEnabled can introduce XSS vulnerabilities into you application, review carefully.” の続きを読む

[Android]エラー対策 The default locale is not appropriate for machine-readable output.

原文
The default locale is not appropriate for machine-readable output. The best choice there is usually Locale.US – this locale is guaranteed to be available on all devices, and the fact that it has no surprising special cases and is frequently used (especially for computer-computer communication) means that it tends to be the most efficient choice too.

Google翻訳
既定のロケールは、機械可読出力には適切ではありません。このロケールはすべてのデバイスで使用できることが保証されています。驚くべき特別なケースはなく、頻繁に使用されている(特にコンピュータとコンピュータの通信に使用されています)ということは、最も効率的な選択肢です。

これだとロケール情報が無いから、漢字とかアラビア語になる可能性もあるよという警告


String.format(“%04d-%02d-%02d”,year,month,day);

正(お好みのLocaleに変更)
String.format(Locale.US,”%04d-%02d-%02d”,year,month,day);

[エラー対応]Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’.

Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’.

原因  Android Studio 3からはcompile の代わりに、implementation が使われるようになった。

修正前
compile fileTree(dir: ‘libs’, include: [‘*.jar’])

修正後
implementation fileTree(dir: ‘libs’, include: [‘*.jar’])

[Android] エラーと対策 Error:Gradle:duplicate files during packaging of APK app-debug-unaligned.apk

原因:複数のライブラリを使うときなどに、同一ファイル名ののファイルなどが入っていると重複エラーが出る。特にReadme的なプログラムに関係のないテキストファイル。

対策:build.gradle(Module:app)にpackagingOptionsを記述する

android {
compileSdkVersion XX

packagingOptions {
exclude ‘META-INF/license.txt’
上記のようにファイル名を列挙する。
ライセンスファイルはたいてい名前が決まっているので
怪しいのは書いておけば良い。
}
}

[Android][Realm]Execution failed for task ‘:app:compileDebugJavaWithJavac’.

org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:37)

原因
引数ありのコンストラクタを作っていた。引数ありのコンストラクタを作る場合は、引数なしのコンストラクタが必要だった。

解決策
モデルクラスに引数なしのコンストラクタを作った。

パッケージの解析中にエラーが発生しました

Android APKからインストール時に発生

メッセージ
パッケージの解析中にエラーが発生しました。

原因
このメッセージの原因は2つある。

1.パッケージファイルの本当の破損。拡張子をzipにして開いてみると良い。ZIPファイルとして開けなかったら本当に破損している。

2.端末OSのバージョンがAPKの要求しているバージョンにあっていない。
よくあるのは、端末のOSバージョンが古すぎる。