rockbruno / SwiftInfo

📊 Extract and analyze the evolution of an iOS app's code.
https://swiftrocks.com
MIT License
1.15k stars 58 forks source link

Don't have permission to view Info.plist #53

Closed LemonSpike closed 3 years ago

LemonSpike commented 3 years ago
bundler: failed to load command: fastlane (/Users/<user>/.rbenv/versions/2.7.1/bin/fastlane)
FastlaneCore::Interface::FastlaneShellError: [!] Exit status of command '../Pods/SwiftInfo/bin/swiftinfo' was 255 instead of 0.
* Extracting ipa_size
* Extracting warning_count
* Extracting archive_time
* Extracting largest_asset
* Extracting warning_count
* Extracting target_count
* Extracting lines_of_code
* **lines_of_code:**     Test log not found!
    Expected path:
    Thrown error: The file “<project_name>” couldn’t be opened because you don’t have permission to view it.
SwiftInfo crashed. Reason: Failed to load plist ...../TestInfo.plist
* SwiftInfo 2.3.12

How do I solve this issue, I am no longer getting Xcode 12.2 warnings, but I now get this crash. Thanks

rockbruno commented 3 years ago

Was the code redacted? Test log not found! means that it looks like you haven't set a testLogFilePath. In any way, permission to view is an error on your file system, you probably have to unlock the file if it's something like a cocoapod.

LemonSpike commented 3 years ago

Ok, so I've now set the testLogFilePath and can confirm that the files exist with the correct name at that path. The testInfo.plist is not locked on my filesystem or Xcode - when I open it in Xcode and edit it, there is no popup saying the file is locked. I've also ensured that test logs generated by test targets that have code coverage reports are enabled in the scheme as per the docs. Could it be a filepath issue? I am getting a .. at the start of an absolute filepath in the error message.

This is my new error and crash log:

[14:02:37]: Exit status of command '../Pods/SwiftInfo/bin/swiftinfo' was 255 instead of 0.
* Extracting ipa_size
* Extracting warning_count
* Extracting archive_time
* Extracting largest_asset
* Extracting warning_count
* Extracting target_count
* Extracting lines_of_code
SwiftInfo crashed. Reason: Failed to load plist ..//Users/<User>/Desktop/..../<project>/<project_dir>/Info/TestInfo.plist
* SwiftInfo 2.3.12
rockbruno commented 3 years ago

Given that there's a .... there it looks like the plist path on your infofile is incorrect. Can you show it here? I think the path on infofiles have to be relative to the project file, but I don't remember fully.

LemonSpike commented 3 years ago

I haven’t included the actual full path here because it contains sensitive product information, however those .... do not include any . characters and are just regular folder names with no spaces or special characters. I am already using Plist path in Xcode as a relative file path.

LemonSpike commented 3 years ago

Resolved the issue by editing build settings, I had edited the Info.plist file path in build settings to be an absolute path. I initially checked the Xcode inspector when viewing the plist, rather than the build settings. Thanks!