Skip to content

Commit be2e3de

Browse files
authored
[shared_preferences_foundation] Add Swift runtime search paths for Objective-C apps (flutter#6952)
1 parent 86eda69 commit be2e3de

File tree

10 files changed

+85
-75
lines changed

10 files changed

+85
-75
lines changed

packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.1.1
2+
3+
* Adds Swift runtime search paths in podspec to avoid crash in Objective-C apps.
4+
Convert example app to Objective-C to catch future Swift runtime issues.
5+
16
## 2.1.0
27

38
* Renames the package previously published as

packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation.podspec

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Wraps NSUserDefaults, providing a persistent store for simple key-value pairs.
1818
s.ios.deployment_target = '9.0'
1919
s.osx.deployment_target = '10.11'
2020
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
21+
s.xcconfig = {
22+
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift',
23+
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
24+
}
2125
s.swift_version = '5.0'
2226

2327
end

packages/shared_preferences/shared_preferences_foundation/example/ios/Podfile

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2828
flutter_ios_podfile_setup
2929

3030
target 'Runner' do
31-
use_frameworks!
32-
use_modular_headers!
33-
3431
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3532
target 'RunnerTests' do
3633
inherit! :search_paths

packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/project.pbxproj

+22-53
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11-
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
1211
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13-
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
12+
7AFB0B132B8D038CBAF02B4E /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D97E85AE85363F61672773 /* libPods-RunnerTests.a */; };
1413
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1514
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1615
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17-
9AF3A5CAB88B27F2BC36D686 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4C443E7E16FB2AD978AC1D6 /* Pods_RunnerTests.framework */; };
18-
B81650923B266CE1F32B75E4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3702C135032CE4599D8327B /* Pods_Runner.framework */; };
16+
AB2C8CA8CB0B570FDC41DF49 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 656AE6DD8C165214F407D2AE /* libPods-Runner.a */; };
17+
F7E47F772970EBA900FA52F3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
18+
F7E47F792970ECCA00FA52F3 /* RunnerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7E47F782970ECCA00FA52F3 /* RunnerTests.m */; };
19+
F7E47F7B2970EDFB00FA52F3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F7E47F7A2970EDFB00FA52F3 /* main.m */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXContainerItemProxy section */
@@ -44,14 +45,15 @@
4445
/* Begin PBXFileReference section */
4546
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4647
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
47-
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ../../../darwin/Tests/RunnerTests.swift; sourceTree = "<group>"; };
48+
32D97E85AE85363F61672773 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4849
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4950
3A8F2565F3AF472E2E0A219E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
5051
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
52+
656AE6DD8C165214F407D2AE /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5153
6F1615DD96BB2B955423149B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
52-
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
53-
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5454
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
55+
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
56+
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
5557
87C77C652D5BC0B23F81E01F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
5658
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5759
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -61,26 +63,26 @@
6163
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6264
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6365
B5E9D2BAFD0E9BF6494E5389 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
64-
D4C443E7E16FB2AD978AC1D6 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6566
D9DC9227831D288079E5C887 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
6667
F1B6CB00204D3430428972D5 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
67-
F3702C135032CE4599D8327B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
68+
F7E47F782970ECCA00FA52F3 /* RunnerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RunnerTests.m; sourceTree = "<group>"; };
69+
F7E47F7A2970EDFB00FA52F3 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6870
/* End PBXFileReference section */
6971

7072
/* Begin PBXFrameworksBuildPhase section */
7173
3F94D8484CE6A0609BCE7680 /* Frameworks */ = {
7274
isa = PBXFrameworksBuildPhase;
7375
buildActionMask = 2147483647;
7476
files = (
75-
9AF3A5CAB88B27F2BC36D686 /* Pods_RunnerTests.framework in Frameworks */,
77+
7AFB0B132B8D038CBAF02B4E /* libPods-RunnerTests.a in Frameworks */,
7678
);
7779
runOnlyForDeploymentPostprocessing = 0;
7880
};
7981
97C146EB1CF9000F007C117D /* Frameworks */ = {
8082
isa = PBXFrameworksBuildPhase;
8183
buildActionMask = 2147483647;
8284
files = (
83-
B81650923B266CE1F32B75E4 /* Pods_Runner.framework in Frameworks */,
85+
AB2C8CA8CB0B570FDC41DF49 /* libPods-Runner.a in Frameworks */,
8486
);
8587
runOnlyForDeploymentPostprocessing = 0;
8688
};
@@ -90,16 +92,16 @@
9092
331C8082294A63A400263BE5 /* RunnerTests */ = {
9193
isa = PBXGroup;
9294
children = (
93-
331C807B294A618700263BE5 /* RunnerTests.swift */,
95+
F7E47F782970ECCA00FA52F3 /* RunnerTests.m */,
9496
);
9597
path = RunnerTests;
9698
sourceTree = "<group>";
9799
};
98100
4E1DD4374F34EBDF7F4214F0 /* Frameworks */ = {
99101
isa = PBXGroup;
100102
children = (
101-
F3702C135032CE4599D8327B /* Pods_Runner.framework */,
102-
D4C443E7E16FB2AD978AC1D6 /* Pods_RunnerTests.framework */,
103+
656AE6DD8C165214F407D2AE /* libPods-Runner.a */,
104+
32D97E85AE85363F61672773 /* libPods-RunnerTests.a */,
103105
);
104106
name = Frameworks;
105107
sourceTree = "<group>";
@@ -139,14 +141,15 @@
139141
97C146F01CF9000F007C117D /* Runner */ = {
140142
isa = PBXGroup;
141143
children = (
144+
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
145+
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
142146
97C146FA1CF9000F007C117D /* Main.storyboard */,
143147
97C146FD1CF9000F007C117D /* Assets.xcassets */,
144148
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
145149
97C147021CF9000F007C117D /* Info.plist */,
146150
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
147151
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
148-
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
149-
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
152+
F7E47F7A2970EDFB00FA52F3 /* main.m */,
150153
);
151154
path = Runner;
152155
sourceTree = "<group>";
@@ -161,7 +164,6 @@
161164
D9DC9227831D288079E5C887 /* Pods-RunnerTests.release.xcconfig */,
162165
B5E9D2BAFD0E9BF6494E5389 /* Pods-RunnerTests.profile.xcconfig */,
163166
);
164-
name = Pods;
165167
path = Pods;
166168
sourceTree = "<group>";
167169
};
@@ -198,7 +200,6 @@
198200
97C146EC1CF9000F007C117D /* Resources */,
199201
9705A1C41CF9048500538489 /* Embed Frameworks */,
200202
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
201-
3AC0A86331B4FD70A0EF91D9 /* [CP] Embed Pods Frameworks */,
202203
);
203204
buildRules = (
204205
);
@@ -224,7 +225,6 @@
224225
};
225226
97C146ED1CF9000F007C117D = {
226227
CreatedOnToolsVersion = 7.3.1;
227-
LastSwiftMigration = 1100;
228228
};
229229
};
230230
};
@@ -269,23 +269,6 @@
269269
/* End PBXResourcesBuildPhase section */
270270

271271
/* Begin PBXShellScriptBuildPhase section */
272-
3AC0A86331B4FD70A0EF91D9 /* [CP] Embed Pods Frameworks */ = {
273-
isa = PBXShellScriptBuildPhase;
274-
buildActionMask = 2147483647;
275-
files = (
276-
);
277-
inputFileListPaths = (
278-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
279-
);
280-
name = "[CP] Embed Pods Frameworks";
281-
outputFileListPaths = (
282-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
283-
);
284-
runOnlyForDeploymentPostprocessing = 0;
285-
shellPath = /bin/sh;
286-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
287-
showEnvVarsInLog = 0;
288-
};
289272
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
290273
isa = PBXShellScriptBuildPhase;
291274
alwaysOutOfDate = 1;
@@ -367,15 +350,16 @@
367350
isa = PBXSourcesBuildPhase;
368351
buildActionMask = 2147483647;
369352
files = (
370-
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
353+
F7E47F792970ECCA00FA52F3 /* RunnerTests.m in Sources */,
371354
);
372355
runOnlyForDeploymentPostprocessing = 0;
373356
};
374357
97C146EA1CF9000F007C117D /* Sources */ = {
375358
isa = PBXSourcesBuildPhase;
376359
buildActionMask = 2147483647;
377360
files = (
378-
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
361+
F7E47F772970EBA900FA52F3 /* AppDelegate.m in Sources */,
362+
F7E47F7B2970EDFB00FA52F3 /* main.m in Sources */,
379363
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
380364
);
381365
runOnlyForDeploymentPostprocessing = 0;
@@ -475,8 +459,6 @@
475459
);
476460
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample;
477461
PRODUCT_NAME = "$(TARGET_NAME)";
478-
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
479-
SWIFT_VERSION = 5.0;
480462
VERSIONING_SYSTEM = "apple-generic";
481463
};
482464
name = Profile;
@@ -492,9 +474,6 @@
492474
MARKETING_VERSION = 1.0;
493475
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample.RunnerTests;
494476
PRODUCT_NAME = "$(TARGET_NAME)";
495-
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
496-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
497-
SWIFT_VERSION = 5.0;
498477
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
499478
};
500479
name = Debug;
@@ -510,7 +489,6 @@
510489
MARKETING_VERSION = 1.0;
511490
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample.RunnerTests;
512491
PRODUCT_NAME = "$(TARGET_NAME)";
513-
SWIFT_VERSION = 5.0;
514492
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
515493
};
516494
name = Release;
@@ -526,7 +504,6 @@
526504
MARKETING_VERSION = 1.0;
527505
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample.RunnerTests;
528506
PRODUCT_NAME = "$(TARGET_NAME)";
529-
SWIFT_VERSION = 5.0;
530507
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
531508
};
532509
name = Profile;
@@ -630,9 +607,6 @@
630607
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
631608
MTL_ENABLE_DEBUG_INFO = NO;
632609
SDKROOT = iphoneos;
633-
SUPPORTED_PLATFORMS = iphoneos;
634-
SWIFT_COMPILATION_MODE = wholemodule;
635-
SWIFT_OPTIMIZATION_LEVEL = "-O";
636610
TARGETED_DEVICE_FAMILY = "1,2";
637611
VALIDATE_PRODUCT = YES;
638612
};
@@ -653,9 +627,6 @@
653627
);
654628
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample;
655629
PRODUCT_NAME = "$(TARGET_NAME)";
656-
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
657-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
658-
SWIFT_VERSION = 5.0;
659630
VERSIONING_SYSTEM = "apple-generic";
660631
};
661632
name = Debug;
@@ -675,8 +646,6 @@
675646
);
676647
PRODUCT_BUNDLE_IDENTIFIER = com.example.sharedPreferencesFoundationExample;
677648
PRODUCT_NAME = "$(TARGET_NAME)";
678-
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
679-
SWIFT_VERSION = 5.0;
680649
VERSIONING_SYSTEM = "apple-generic";
681650
};
682651
name = Release;
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#import "GeneratedPluginRegistrant.h"
5+
#import <Flutter/Flutter.h>
6+
#import <UIKit/UIKit.h>
7+
8+
@interface AppDelegate : FlutterAppDelegate
9+
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "AppDelegate.h"
6+
#include "GeneratedPluginRegistrant.h"
7+
8+
@implementation AppDelegate
9+
10+
- (BOOL)application:(UIApplication *)application
11+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
12+
[GeneratedPluginRegistrant registerWithRegistry:self];
13+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
14+
}
15+
16+
@end

packages/shared_preferences/shared_preferences_foundation/example/ios/Runner/AppDelegate.swift

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import <Flutter/Flutter.h>
6+
#import <UIKit/UIKit.h>
7+
#import "AppDelegate.h"
8+
9+
int main(int argc, char *argv[]) {
10+
@autoreleasepool {
11+
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
@import shared_preferences_foundation;
6+
@import XCTest;
7+
8+
@interface SharedPreferencesTests : XCTestCase
9+
@end
10+
11+
@implementation SharedPreferencesTests
12+
13+
- (void)testPlugin {
14+
SharedPreferencesPlugin *plugin = [[SharedPreferencesPlugin alloc] init];
15+
XCTAssertNotNil(plugin);
16+
}
17+
18+
@end

packages/shared_preferences/shared_preferences_foundation/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: shared_preferences_foundation
22
description: iOS and macOS implementation of the shared_preferences plugin.
33
repository: https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_foundation
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
5-
version: 2.1.0
5+
version: 2.1.1
66

77
environment:
88
sdk: ">=2.12.0 <3.0.0"

0 commit comments

Comments
 (0)