私のアプリにロードする必要があるプラグインバンドルがあります。 私はiOSのシミュレータでアプリを実行すると、バンドルが正しくセットされているが、私は私の本当のデバイス上でアプリケーションを実行するために、プロジェクトを再コンパイルするとき、私は次のエラーを取得する:実際のデバイスにiOSバンドルをロードしています
Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter): no suitable image found. Did find:
/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter: mmap() error 1 at address=0x022CF000, size=0x00008000 segment=__TEXT in Segment::map() mapping /var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter" UserInfo={NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter, NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedDescription=The bundle “grandmaAdapter” couldn’t be loaded because it is damaged or missing necessary resources., NSDebugDescription=dlopen_preflight(/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter): no suitable image found. Did find:
/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter: mmap() error 1 at address=0x022CF000, size=0x00008000 segment=__TEXT in Segment::map() mapping /var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle/grandmaAdapter, NSBundlePath=/var/mobile/Containers/Data/Application/35F71C99-1072-4772-8BFB-3CB8C034A935/Documents/grandmaAdapter.bundle}
基本的に私は何をすべきか次のとおりです。その後、ドキュメントディレクトリ内のファイルパスを-Defining
NSString *bundleName = [NSString stringWithFormat:@"%@.bundle", bundle];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
filePath = [documentsDirectory stringByAppendingPathComponent:bundleName];
- およびバンドルに
NSBundle *plugin = [[NSBundle alloc] initWithPath:filePath];
NSError *err;
if(![plugin loadAndReturnError:&err]) {
// err contains error info
} else {
// bundle loaded properly
}
をロードします
ここに私は上記のエラーがあります
誰かが私を助けることができますか?おかげ
はエラーがコード署名の欠如に関連していた
を解決しました。この記事で報告されているように :http://ddeville.me/2014/04/dynamic-linking/ プラグインは、次のコマンドを使用して、実際のデバイスにロードするために署名する必要があります
codesign --sign "iPhone Developer" --force --verbose=4 myPluginName.plugin
バンドルをSimulatorにどのようにロードしましたか?プログラム的には、コードを表示してください。 – Sheamus
自分のコードを編集しました – davideb
問題はディレクトリアクセス権の問題に関連する可能性がありますか(実際のデバイス上)。メッセージには破損したデータや不足しているデータが含まれているとレポートされていますが、 – davideb