iOSで配信時、配信用の証明書 iOS Distribution は最大、2枚か3枚までしか作成できない。
なのでアプリ毎に証明書を作成してはいけない。
カテゴリー: 未分類
Unity D8: Cannot fit requested classes in a single dex file
D8: Cannot fit requested classes in a single dex file
のエラー
パッケージなどを追加して、メソッドが 65536 数を超えると発生するらしい。
ビルド方法が Gradle になっていないことが、原因。
Player Setting の
Publishing Settings の
Minify Release Debug に Gradle に変更で対応できた。
Could not find an installed version of Gradle either in Android Studio
> cordova build android
で、ある日突然、以下のエラーが・・・
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
あれ、gradle コマンドにパスが通っていない??
Android Studio はインストールされているし、最近 Android Studio も使っていないのに・・・
でも、フォルダーの日付を見てみると、アップデートが最近あったような
結局、Gradle をダウンロードしてきて、
(https://gradle.org/releases/ の binary-only から)
C:\gradle-6.3 に配置して
環境変数に
GRADLE_HOME C:\gradle-6.3
パスに
%GRADLE_HOME%\bin
を追加したところ、ビルドできた。
以前まで使えていた gradle はどこに行ったんだろう。
Unity Prefab の処理は SendMessage() か GetComponent() か?
なんとなく、個別のPrefabに対しても指示を出すときは SendMessage() を使っていた。
実際は GetComponent() の方が早いし、Prefab インスタンスの状態も取得できるので
GetComponent() 良いかもしれない。
xxxxx.instance.GetComponent
xampp DocumentRoot Access forbidden! 403
httpd-vhosts.conf を変更して
プロジェクト毎に別のフォルダーを DocumentRoot にしようとすると
DocumentRoot “C:/xampp/htdocs” 以下の時は問題なかったのに
DocumentRoot “C:/projects/hogehoge\htdocs” のようにすると
Access forbidden! となる。
対処方法は Directory でフォルダーに権限を設定
DocumentRoot "C:/projects/hogehoge\htdocs" <Directory "C:/projects/hogehoge\htdocs"> Require all granted </Directory>
cordova-plugin-firebase から cordova-plugin-firebasex へ
過去の記事でビルドエラーの対策を投稿したが、今後は新たなプラグインに
切り替える必要がありそうです。
cordova-plugin-firebasex
https://github.com/dpa99c/cordova-plugin-firebasex
簡単に移行できるのか?
最低以下の環境にする必要あり。
cordova@9(CLI)
cordova-android@8(Androidプラットフォーム)
cordova-ios@5(iOSプラットフォーム)
プラグインを変更
cordova plugin rm cordova-plugin-firebase
※先に cordova platform rm android しておかないと以下のエラーが
Uninstalling cordova-plugin-firebase from android
Error during processing of action! Attempting to revert…
cordova-plugin-firebase を動かすために入れたプラグインはとりあえず外す
自動的に cordova-plugin-firebasex が必要なものは追加してくれるはず
cordova plugin rm cordova-android-firebase-gradle-release
cordova plugin rm cordova-android-play-services-gradle-release
firebasex を入れてみる
cordova plugin add cordova-plugin-firebasex
① onNotificationOpen() を onMessageReceived() に変更
② hasPermission の判定方法変更
if( device.platform == “iOS” ) {
window.FirebasePlugin.hasPermission(function(hasPermission){
if (hasPermission) {
console.log(“Permission to receive notification is granted.”);
} else {
console.log(“Permission to receive notification is NOT granted.”);
window.FirebasePlugin.grantPermission();
}
});
}
③ notification.tap の判定方法変更 おそらく文字列 ”foreground” もしくは “background” で判断
window.FirebasePlugin.onMessageReceived(function(notification) {
console.log(“FirebasePlugin.onMessageReceived”);
console.log(JSON.stringify(notification));
// タップして起動した場合
console.log(“Message type: ” + notification.messageType);
if(notification.messageType === “notification”){
alert(“Notification message received”);
if(notification.tap){
alert(“Tapped in ” + notification.tap);
// “foreground” もしくは “background”
}
}
// firebase からの送信時は notification.message は設定されない
if (typeof cordova !== “undefined”) {
navigator.notification.alert(
notification.message, // message(JSONで追加して送信している情報)
//notification.body, // body
onAlertDismissed, // callback
notification.title, // title
‘閉じる’ // buttonName
);
/*
if( device.platform == “Android” ) {
cordova.plugins.notification.badge.increase();
}
*/
} else {
alert(“The notification is open!”);
}
}, function(error) {
console.log(error);
});
これだけで、すんなり、そのまま動いた!!
ios 版はやはり、mac で platform add するのがよさそう。 windowsだと pod を正しくインストールできない
cordova platform rm ios
cordova platform add ios@latest
Failed to install ‘cordova-plugin-firebase’: CordovaError: Using “requireCordovaModule” to load non-cordova module “xcode” is not supported. Instead, add this module to your dependencies and use regular “require” to load it.
windows 環境で
codova platform add ios
を実行すると、表題のエラー。
cordova-plugin-firebase を使うなら、xcodeが入っている
mac で開発環境を作るしかないのかも。
FBSDKCoreKit/FBSDKCoreKit.h’ file not found cordova-plugin-faceboook4 v6.2.0
cordova-plugin-facebook4 が v5.0.0 の時はエラーがでなかったが
v6.2.0 になり、xcode でビルドしようとすると FBSDKCoreKit.h が見つからないエラー
結果、
xcode のプロジェクトを
xxxx.xcodeproj から起動していたのを
xxxx.xcworkspace から起動すれば正常にビルドできた。
2日間は悩んだ。公式サイトをじっくり確認するべきだった。
https://github.com/jeduan/cordova-plugin-facebook4/issues/820
cordova platform add ios は mac で行わないと podが正しくアップデートされない。
failed to install ‘cordova-plugin-facebook4’ Error: pod: Command failed with exit code 31
pod を新しくしないといけないようだ。
大抵は
$ pod repo update
だけで、大丈夫だと思うのだが
以下まで必要な場合もある。
$ brew update
$ brew upgrade
$ sudo gem install cocoapods
$ pod repo update
could not find include file pods/target
mac os か xcode をアップデートすると
上記のようなエラーが出て、xcode でコンパイルできなくなる時がある。
pod install のインストールが必要なのだが、エラーが出る
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
cocoapods をアップデートする必要があるみたい。
sudo gem install -n /usr/local/bin cocoapods
でエラーがなくなった。