繁体   English   中英

为什么我的应用程序不能安装在模拟器或设备上 iOS xcode

[英]Why won't my application install on simulator or device iOS xcode

尝试构建和运行我的应用程序时,出现以下错误

Details

Failed to install the requested application
Domain: NSPOSIXErrorDomain
Code: 22
Failure Reason: The bundle identifier of the application could not be determined.
Recovery Suggestion: Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
User Info: {
    bundleURL = "file:///Users/davidhouse/Library/Developer/Xcode/DerivedData/Pikit-evrjzcfwqbcrxwfgrnarwlnvwoli/Build/Products/Debug-iphonesimulator/Pikit.app/";
}
--


System Information

macOS Version 10.15.5 (Build 19F101)
Xcode 11.5 (16139)

这是我的 info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSCameraUsageDescription</key>
    <string>${PRODUCT_NAME} needs access to your camera to share your ideas with friends</string>
    <key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <false/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneConfigurationName</key>
                    <string>Default Configuration</string>
                    <key>UISceneDelegateClassName</key>
                    <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
                    <key>UISceneStoryboardFile</key>
                    <string>Main</string>
                </dict>
            </array>
        </dict>
    </dict>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

如您所见,有一个CFBundleIdentifier条目。 该应用程序安装和运行较早,我没有对 plist 进行任何更改。

我曾尝试在模拟(iPhone 11 pro)和真实设备(iPad mini)上运行该应用程序,这两种设备以前都可以使用。

我尝试运行干净的构建文件夹,重新启动 xcode,删除并重新安装我的 pod 文件,删除并重新创建我的 plist,删除 DerivedData 文件夹并重建,并更新我的计算机,但均未成功。 任何帮助将不胜感激,如果我能提供更多信息,请告诉我。

从头开始重新创建我的项目后,我能够让它在模拟器上运行,但是它仍然没有安装在我的实际设备上。 这是我得到的错误:

Details

Unable to install "Pikit"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
--
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
User Info: {
    DVTRadarComponentKey = 282703;
    MobileDeviceErrorCode = "(0xE8000051)";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x000000011f36581a DTDKCreateNSErrorFromAMDErrorCode + 233
    1   DTDeviceKitBase                     0x000000011f3a6f70 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
    2   DVTFoundation                       0x0000000106230155 DVTInvokeWithStrongOwnership + 73
    3   DTDeviceKitBase                     0x000000011f3a6ca8 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1654
    4   IDEiOSSupportCore                   0x000000011f21de91 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4165
    5   DVTFoundation                       0x00000001063637f4 __DVT_CALLING_CLIENT_BLOCK__ + 7
    6   DVTFoundation                       0x0000000106365436 __DVTDispatchAsync_block_invoke + 1194
    7   libdispatch.dylib                   0x00007fff70bee6c4 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x00007fff70bef658 _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00007fff70bf4c44 _dispatch_lane_serial_drain + 597
    10  libdispatch.dylib                   0x00007fff70bf55d6 _dispatch_lane_invoke + 363
    11  libdispatch.dylib                   0x00007fff70bfec09 _dispatch_workloop_worker_thread + 596
    12  libsystem_pthread.dylib             0x00007fff70e4da3d _pthread_wqthread + 290
    13  libsystem_pthread.dylib             0x00007fff70e4cb77 start_wqthread + 15
);
}
--


System Information

macOS Version 10.15.5 (Build 19F101)
Xcode 11.5 (16139)

我可以复制这个问题并得到同样的错误。 在此处输入图像描述

要在目标的构建设置中解决对PRODUCT_BUNDLE_IDENTIFIER的搜索并在那里添加一个值。 如下所示

在此处输入图像描述

清理所有并构建。 希望会奏效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM