tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

xcodebuild: WARNING: Using the first of multiple matching destinations: #13175

Closed walkthelot closed 3 years ago

walkthelot commented 3 years ago

Posted initially on TISlack. Josh Lambert asked me to post here.

Hello all. I am at my wits end. Trying to get TI development environment setup on a new Mac Mini M1. I've setup Atom and VSCode to successfully install on iOS and Android Simulators and also Android devices. No matter what I try I can not get it to install on any iOS devices. I've checked my certificates and provisioning profiles time and time again and all is good. I am able to install to device from XCode (created a test project).

The iOS devices show up as targets in Atom and VSCode and also via "appc info". In appc info everything looks good. Any help would be GREATLY appreciated. I am like a week and half in and 5 virgin MacOS installs trying to get this going.

PS: I tried a direct command line deploy to device as well about 4 days ago with the same result.

Here is what I get in console upon building to install on iOS device: [INFO] Invoking xcodebuild [ERROR] 2021-11-11 19:46:05.864 xcodebuild[4928:34077] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-19450/DTDeviceKitBase/DTDKRemoteDeviceData.m:373 [ERROR] Details: (null) deviceType from 00008020-000C19CC2E69402E was NULL when -platform called. [ERROR] Object: <DTDKMobileDeviceToken: 0x7fe07ac56520> [ERROR] Method: -platform [ERROR] Thread: <NSThread: 0x600002b1c180>{number = 3, name = (null)} [ERROR] Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. [ERROR] --- xcodebuild: WARNING: Using the first of multiple matching destinations:

MacOS 12.0.1 (latest public release) XCode 13.1 (latest public release) appc version 9.0.1 (latest I believe) appc ti 5.3.2 TI SDK 10.1.0.GA JDK 14.0.2 Node.js 14.18.1

Let me know if any other details are needed. I think I will try an older version of Xcode and also the latest beta tomorrow to see if that does anything. Thanks!

walkthelot commented 3 years ago

PS: This is with a default new Titanium project. I reverted to testing with the default base new TI project rather than one of my own projects to simplify troubleshooting and remove any possibilities that anything in my code could be causing it.

walkthelot commented 3 years ago

This corrected the issue: https://github.com/appcelerator/titanium_mobile/pull/13172/files

Changed /Users/YOUR_USER/Library/Application Support/Titanium/mobilesdk/osx/10.1.0.GA/iphone/cli/commands/iphone/cli/commands/_build.js

Change this:

if (this.simHandle && this.target !== 'macos' && this.target !== 'dist-macappstore') {
    args.push('-destination', 'generic/platform=iOS Simulator');

    // only build active architecture, which is 64-bit, if simulator is not 32-bit (iPhone 5s or newer, iPhone 5 and older are not 64-bit)
    if (this.simOnlyActiveArch) {
        args.push('ONLY_ACTIVE_ARCH=1');
    }
    // Exclude arm64 architecture from simulator build in XCode 12+ - TIMOB-28042
    if (this.legacyModules.size > 0 && parseFloat(this.xcodeEnv.version) >= 12.0) {
        if (await processArchitecture() === 'arm64') {
            return next(new Error(`The app is using native modules that do not support arm64 simulators and you are on an arm64 device:\n- ${Array.from(this.legacyModules).join('\n- ')}`));
        }
        this.logger.warn(`The app is using native modules (${Array.from(this.legacyModules)}) that do not support arm64 simulators, we will exclude arm64. This may fail if you're on an arm64 Apple Silicon device.`);
        args.push('EXCLUDED_ARCHS=arm64');
    }
}

...to this:

if (this.simHandle && this.target !== 'macos' && this.target !== 'dist-macappstore') {
    args.push('-destination', 'generic/platform=iOS Simulator');

    // only build active architecture, which is 64-bit, if simulator is not 32-bit (iPhone 5s or newer, iPhone 5 and older are not 64-bit)
    if (this.simOnlyActiveArch) {
        args.push('ONLY_ACTIVE_ARCH=1');
    }
    // Exclude arm64 architecture from simulator build in XCode 12+ - TIMOB-28042
    if (this.legacyModules.size > 0 && parseFloat(this.xcodeEnv.version) >= 12.0) {
        if (await processArchitecture() === 'arm64') {
            return next(new Error(`The app is using native modules that do not support arm64 simulators and you are on an arm64 device:\n- ${Array.from(this.legacyModules).join('\n- ')}`));
        }
        this.logger.warn(`The app is using native modules (${Array.from(this.legacyModules)}) that do not support arm64 simulators, we will exclude arm64. This may fail if you're on an arm64 Apple Silicon device.`);
        args.push('EXCLUDED_ARCHS=arm64');
    }
**_} else if (this.target === 'device' || this.target === 'dist-adhoc') {
    args.push('-destination', 'generic/platform=iOS');_**
}
walkthelot commented 3 years ago

Based on the code in the link that solved the issue, I believe they have already made this change and it will be a part of the next release. Therefore, closing the issue. Thanks all!