Unity から xcode を出力時、unable to install xcode のエラーで
端末にインストールできなかった。
理由はよくわかっていないが
証明書設定の Signing & Capabilities の設定で
Release と Debug で設定を変えているとうまくいかない。
All の状態で Automatically manage signing で
Release と Debug ともに同じ状態にしておくと転送できた。
Unity から xcode を出力時、unable to install xcode のエラーで
端末にインストールできなかった。
理由はよくわかっていないが
証明書設定の Signing & Capabilities の設定で
Release と Debug で設定を変えているとうまくいかない。
All の状態で Automatically manage signing で
Release と Debug ともに同じ状態にしておくと転送できた。
Unityでプロジェクトを作成すると
xcode でシミュレータが表示されなかった。
対策は、
Build Settings ->Architectures
Supported Platforms を iOS にしてあげると良い。
xcode のシュミレータ一覧が表示されず
実機でしか確認できな。
iPad で画面キャプチャしたいのに。
Unity でビルドした場合、
xcode の Build Settings の Supported Platforms が iphoneosになっていたので iOS に変更
表示されるようになった。
非推奨になったライブラリが対応してもらうまでに
先に修正して対応。
//string target = proj.TargetGuidByName("Unity-iPhone"); #if UNITY_2019_3_OR_NEWER string target = proj.GetUnityFrameworkTargetGuid(); #else string target = proj.TargetGuidByName(PBXProject.GetUnityTargetName()); #endif
iOSで配信時、配信用の証明書 iOS Distribution は最大、2枚か3枚までしか作成できない。
なのでアプリ毎に証明書を作成してはいけない。
D8: Cannot fit requested classes in a single dex file
のエラー
パッケージなどを追加して、メソッドが 65536 数を超えると発生するらしい。
ビルド方法が Gradle になっていないことが、原因。
Player Setting の
Publishing Settings の
Minify Release Debug に Gradle に変更で対応できた。
> 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 はどこに行ったんだろう。
なんとなく、個別のPrefabに対しても指示を出すときは SendMessage() を使っていた。
実際は GetComponent() の方が早いし、Prefab インスタンスの状態も取得できるので
GetComponent() 良いかもしれない。
xxxxx.instance.GetComponent
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-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