Skip to content

Commit

Permalink
fixed apps crashing when run on simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
dbejanishvili committed Jun 27, 2021
1 parent 75c6e3d commit a8ddb80
Show file tree
Hide file tree
Showing 40 changed files with 445 additions and 48 deletions.
82 changes: 82 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/MavisSDK.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MavisSDK"
BuildableName = "MavisSDK"
BlueprintName = "MavisSDK"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MavisSDKToBeWrapped"
BuildableName = "MavisSDKToBeWrapped"
BlueprintName = "MavisSDKToBeWrapped"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MavisSDK"
BuildableName = "MavisSDK"
BlueprintName = "MavisSDK"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
6 changes: 1 addition & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@

import PackageDescription

let notSimulator:TargetDependencyCondition = .when(platforms: [.iOS,.watchOS])

let package = Package(
name: "MavisSDK",
products: [
.library(
name: "MavisSDK",
type: .dynamic,
targets: ["MavisSDK"]),
],
dependencies: [
],
targets: [
.target(
name: "MavisSDK",
dependencies: [
.byName(name: "UnityFramework",condition: notSimulator),
.byName(name: "WikitudeSDK", condition: notSimulator)]),
dependencies: ["UnityFramework","WikitudeSDK"]),
.binaryTarget(
name: "UnityFramework",
path: "UnityFramework.xcframework"),
Expand Down
15 changes: 14 additions & 1 deletion Sources/MavisSDK/Mavis.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
#if !targetEnvironment(simulator)
import UnityFramework

public class Mavis: UIResponder, UIApplicationDelegate {
Expand Down Expand Up @@ -100,4 +101,16 @@ public class Mavis: UIResponder, UIApplicationDelegate {
}



#else
import UIKit
public class Mavis{
public static func Init(_ options : MavisOptions){
}
public static func Launch(_ parentWindow: UIWindow?) {
}
public static func setEventHandler(_ customEventHandler: MavisEventHandlerBase!){
}
public static func unloadUnity(){
}
}
#endif
8 changes: 8 additions & 0 deletions Sources/MavisSDK/MavisUnityListener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
//

import Foundation
#if !targetEnvironment(simulator)
import UnityFramework

class MavisUnityListener: UIResponder, UIApplicationDelegate, UnityFrameworkListener {
public func unityDidUnload(_ notification: Notification!) {
Mavis.unloadUnity();
}
}
#else
class MavisUnityListener {
public func unityDidUnload(_ notification: Notification!) {
}
}

#endif
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,13 @@
"moduleName": "",
"usedInScenes": []
},
{
"managedAssemblyName": "Assembly-CSharp.dll",
"nativeClass": "",
"fullManagedTypeName": "SafeAreaFilter",
"moduleName": "",
"usedInScenes": []
},
{
"managedAssemblyName": "UnityEngine.UI.dll",
"nativeClass": "",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<type fullname="AugmentationEvents" preserve="nothing"/>
<type fullname="CloseButtonScript" preserve="nothing"/>
<type fullname="DotsAnimationScript" preserve="nothing"/>
<type fullname="SafeAreaFilter" preserve="nothing"/>
</assembly>
<assembly fullname="UnityEngine.UI">
<type fullname="UnityEngine.EventSystems.EventSystem" preserve="nothing"/>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-out="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/tempStrip" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x="/var/folders/rp/14gmxxms0pjc96j56ckdks1w0000gn/T/tmp6e3e537c.tmp" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/TypesInScenes.xml" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Assets/Wikitude/Dependencies/link.xml" -d="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/WikitudeUnityPlugin.dll" --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed" --rule-set=Conservative --editor-data-file="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json" --platform=iOS --enable-engine-module-stripping --engine-modules-asset-file="/Applications/Unity/Hub/Editor/2019.4.17f1/PlaybackEngines/iOSSupport/Whitelists/../modules.asset"
-out="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/tempStrip" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x="/var/folders/rp/14gmxxms0pjc96j56ckdks1w0000gn/T/tmp6faab54d.tmp" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/TypesInScenes.xml" -x="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Assets/Wikitude/Dependencies/link.xml" -d="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" --include-unity-root-assembly="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/WikitudeUnityPlugin.dll" --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed" --editor-settings-flag=Development --rule-set=Conservative --editor-data-file="/Users/lashabukhnikashvili/Desktop/Dzliera/MavisUnity/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json" --platform=iOS --enable-engine-module-stripping --engine-modules-asset-file="/Applications/Unity/Hub/Editor/2019.4.17f1/PlaybackEngines/iOSSupport/Whitelists/../modules.asset"
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
player-connection-mode=Listen
player-connection-guid=2260481160
player-connection-debug=0
player-connection-project-name=Mavis
player-connection-ip=192.168.20.103
player-connection-ip=169.254.156.229
wait-for-native-debugger=0
vr-enabled=0
hdr-display-enabled=0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit a8ddb80

Please sign in to comment.