Skip to content

Commit 869dd3c

Browse files
committed
* ios真机编译、修复数据库问题修复
* ios支持release发布
1 parent f180f67 commit 869dd3c

File tree

6 files changed

+263
-12
lines changed

6 files changed

+263
-12
lines changed

RECORD.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,15 @@ hotload很有优势。
8282

8383
### redux 下切换主题
8484

85-
### 谷歌推荐redux
85+
### 谷歌推荐redux
86+
87+
https://blog.csdn.net/yaoliangjun306/article/details/77824136
88+
flutter 运行ios项目失败 'shared_preferences/SharedPreferencesPlugin.h' file not found
89+
90+
flutter 真机测试
91+
https://blog.csdn.net/hekaiyou/article/details/52874796?locationNum=4&fps=1
92+
93+
///ios编译失败
94+
https://github.com/flutter/flutter/issues/19241#issuecomment-404601754
95+
96+
https://github.com/flutter/flutter/issues/18305

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DEPENDENCIES:
4444
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
4545

4646
SPEC REPOS:
47-
https://github.com/CocoaPods/Specs.git:
47+
https://github.com/cocoapods/specs.git:
4848
- FMDB
4949
- Reachability
5050

@@ -92,4 +92,4 @@ SPEC CHECKSUMS:
9292

9393
PODFILE CHECKSUM: 7765ea4305eaab0b3dfd384c7de11902aa3195fd
9494

95-
COCOAPODS: 1.5.0
95+
COCOAPODS: 1.5.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 236 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,107 @@
2323
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
2424
/* End PBXBuildFile section */
2525

26+
/* Begin PBXContainerItemProxy section */
27+
4B51211D211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
28+
isa = PBXContainerItemProxy;
29+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
30+
proxyType = 2;
31+
remoteGlobalIDString = 6B534DBBA8DF3878886AC541E1F9B27F;
32+
remoteInfo = connectivity;
33+
};
34+
4B51211F211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
35+
isa = PBXContainerItemProxy;
36+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
37+
proxyType = 2;
38+
remoteGlobalIDString = FE03FE86639A72DA4B3E03B276CF9787;
39+
remoteInfo = device_info;
40+
};
41+
4B512121211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
42+
isa = PBXContainerItemProxy;
43+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
44+
proxyType = 2;
45+
remoteGlobalIDString = 2AC289AB40D998EA7DBA2D915D4D9018;
46+
remoteInfo = flutter_statusbar;
47+
};
48+
4B512123211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
49+
isa = PBXContainerItemProxy;
50+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
51+
proxyType = 2;
52+
remoteGlobalIDString = F5F68C588E60E4B9DF08A7029A63E587;
53+
remoteInfo = flutter_webview_plugin;
54+
};
55+
4B512125211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
56+
isa = PBXContainerItemProxy;
57+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
58+
proxyType = 2;
59+
remoteGlobalIDString = A01BD7926EF9CCFC9422AAE0154B021C;
60+
remoteInfo = fluttertoast;
61+
};
62+
4B512127211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
63+
isa = PBXContainerItemProxy;
64+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
65+
proxyType = 2;
66+
remoteGlobalIDString = 05CFA344FD05BDC7846987FC69E2968D;
67+
remoteInfo = FMDB;
68+
};
69+
4B512129211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
70+
isa = PBXContainerItemProxy;
71+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
72+
proxyType = 2;
73+
remoteGlobalIDString = C2168EE11486D639FC8BD7CB7AF2AA7A;
74+
remoteInfo = get_version;
75+
};
76+
4B51212B211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
77+
isa = PBXContainerItemProxy;
78+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
79+
proxyType = 2;
80+
remoteGlobalIDString = F3ECC93A65C1AC7391162CC6DE987104;
81+
remoteInfo = package_info;
82+
};
83+
4B51212D211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
84+
isa = PBXContainerItemProxy;
85+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
86+
proxyType = 2;
87+
remoteGlobalIDString = 07082C9AE15BEF3C3E1B87A9E0002399;
88+
remoteInfo = "Pods-Runner";
89+
};
90+
4B51212F211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
91+
isa = PBXContainerItemProxy;
92+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
93+
proxyType = 2;
94+
remoteGlobalIDString = 3980A755FA9D435ACB2BB8E062462E50;
95+
remoteInfo = Reachability;
96+
};
97+
4B512131211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
98+
isa = PBXContainerItemProxy;
99+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
100+
proxyType = 2;
101+
remoteGlobalIDString = FA6117CD532A944FB87D5A01C425C052;
102+
remoteInfo = share;
103+
};
104+
4B512133211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
105+
isa = PBXContainerItemProxy;
106+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
107+
proxyType = 2;
108+
remoteGlobalIDString = 5AD4D046EA66405A678044C7D231DED9;
109+
remoteInfo = shared_preferences;
110+
};
111+
4B512135211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
112+
isa = PBXContainerItemProxy;
113+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
114+
proxyType = 2;
115+
remoteGlobalIDString = 395F12FD509BCF5B8F35276A25ED61E9;
116+
remoteInfo = sqflite;
117+
};
118+
4B512137211F395B00E0C9B3 /* PBXContainerItemProxy */ = {
119+
isa = PBXContainerItemProxy;
120+
containerPortal = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
121+
proxyType = 2;
122+
remoteGlobalIDString = 4B40ADA9AD61ADB08CA9739165A77AE5;
123+
remoteInfo = url_launcher;
124+
};
125+
/* End PBXContainerItemProxy section */
126+
26127
/* Begin PBXCopyFilesBuildPhase section */
27128
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
28129
isa = PBXCopyFilesBuildPhase;
@@ -44,6 +145,7 @@
44145
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
45146
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
46147
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
148+
4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = "<group>"; };
47149
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
48150
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
49151
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -72,9 +174,31 @@
72174
/* End PBXFrameworksBuildPhase section */
73175

74176
/* Begin PBXGroup section */
177+
4B51210D211F395A00E0C9B3 /* Products */ = {
178+
isa = PBXGroup;
179+
children = (
180+
4B51211E211F395B00E0C9B3 /* connectivity.framework */,
181+
4B512120211F395B00E0C9B3 /* device_info.framework */,
182+
4B512122211F395B00E0C9B3 /* flutter_statusbar.framework */,
183+
4B512124211F395B00E0C9B3 /* flutter_webview_plugin.framework */,
184+
4B512126211F395B00E0C9B3 /* fluttertoast.framework */,
185+
4B512128211F395B00E0C9B3 /* FMDB.framework */,
186+
4B51212A211F395B00E0C9B3 /* get_version.framework */,
187+
4B51212C211F395B00E0C9B3 /* package_info.framework */,
188+
4B51212E211F395B00E0C9B3 /* Pods_Runner.framework */,
189+
4B512130211F395B00E0C9B3 /* Reachability.framework */,
190+
4B512132211F395B00E0C9B3 /* share.framework */,
191+
4B512134211F395B00E0C9B3 /* shared_preferences.framework */,
192+
4B512136211F395B00E0C9B3 /* sqflite.framework */,
193+
4B512138211F395B00E0C9B3 /* url_launcher.framework */,
194+
);
195+
name = Products;
196+
sourceTree = "<group>";
197+
};
75198
547008C5C91FE4BDD08FA652 /* Pods */ = {
76199
isa = PBXGroup;
77200
children = (
201+
4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */,
78202
);
79203
name = Pods;
80204
sourceTree = "<group>";
@@ -179,6 +303,7 @@
179303
TargetAttributes = {
180304
97C146ED1CF9000F007C117D = {
181305
CreatedOnToolsVersion = 7.3.1;
306+
DevelopmentTeam = B29J9885S3;
182307
LastSwiftMigration = 0910;
183308
};
184309
};
@@ -194,13 +319,120 @@
194319
mainGroup = 97C146E51CF9000F007C117D;
195320
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
196321
projectDirPath = "";
322+
projectReferences = (
323+
{
324+
ProductGroup = 4B51210D211F395A00E0C9B3 /* Products */;
325+
ProjectRef = 4B51210C211F395A00E0C9B3 /* Pods.xcodeproj */;
326+
},
327+
);
197328
projectRoot = "";
198329
targets = (
199330
97C146ED1CF9000F007C117D /* Runner */,
200331
);
201332
};
202333
/* End PBXProject section */
203334

335+
/* Begin PBXReferenceProxy section */
336+
4B51211E211F395B00E0C9B3 /* connectivity.framework */ = {
337+
isa = PBXReferenceProxy;
338+
fileType = wrapper.framework;
339+
path = connectivity.framework;
340+
remoteRef = 4B51211D211F395B00E0C9B3 /* PBXContainerItemProxy */;
341+
sourceTree = BUILT_PRODUCTS_DIR;
342+
};
343+
4B512120211F395B00E0C9B3 /* device_info.framework */ = {
344+
isa = PBXReferenceProxy;
345+
fileType = wrapper.framework;
346+
path = device_info.framework;
347+
remoteRef = 4B51211F211F395B00E0C9B3 /* PBXContainerItemProxy */;
348+
sourceTree = BUILT_PRODUCTS_DIR;
349+
};
350+
4B512122211F395B00E0C9B3 /* flutter_statusbar.framework */ = {
351+
isa = PBXReferenceProxy;
352+
fileType = wrapper.framework;
353+
path = flutter_statusbar.framework;
354+
remoteRef = 4B512121211F395B00E0C9B3 /* PBXContainerItemProxy */;
355+
sourceTree = BUILT_PRODUCTS_DIR;
356+
};
357+
4B512124211F395B00E0C9B3 /* flutter_webview_plugin.framework */ = {
358+
isa = PBXReferenceProxy;
359+
fileType = wrapper.framework;
360+
path = flutter_webview_plugin.framework;
361+
remoteRef = 4B512123211F395B00E0C9B3 /* PBXContainerItemProxy */;
362+
sourceTree = BUILT_PRODUCTS_DIR;
363+
};
364+
4B512126211F395B00E0C9B3 /* fluttertoast.framework */ = {
365+
isa = PBXReferenceProxy;
366+
fileType = wrapper.framework;
367+
path = fluttertoast.framework;
368+
remoteRef = 4B512125211F395B00E0C9B3 /* PBXContainerItemProxy */;
369+
sourceTree = BUILT_PRODUCTS_DIR;
370+
};
371+
4B512128211F395B00E0C9B3 /* FMDB.framework */ = {
372+
isa = PBXReferenceProxy;
373+
fileType = wrapper.framework;
374+
path = FMDB.framework;
375+
remoteRef = 4B512127211F395B00E0C9B3 /* PBXContainerItemProxy */;
376+
sourceTree = BUILT_PRODUCTS_DIR;
377+
};
378+
4B51212A211F395B00E0C9B3 /* get_version.framework */ = {
379+
isa = PBXReferenceProxy;
380+
fileType = wrapper.framework;
381+
path = get_version.framework;
382+
remoteRef = 4B512129211F395B00E0C9B3 /* PBXContainerItemProxy */;
383+
sourceTree = BUILT_PRODUCTS_DIR;
384+
};
385+
4B51212C211F395B00E0C9B3 /* package_info.framework */ = {
386+
isa = PBXReferenceProxy;
387+
fileType = wrapper.framework;
388+
path = package_info.framework;
389+
remoteRef = 4B51212B211F395B00E0C9B3 /* PBXContainerItemProxy */;
390+
sourceTree = BUILT_PRODUCTS_DIR;
391+
};
392+
4B51212E211F395B00E0C9B3 /* Pods_Runner.framework */ = {
393+
isa = PBXReferenceProxy;
394+
fileType = wrapper.framework;
395+
path = Pods_Runner.framework;
396+
remoteRef = 4B51212D211F395B00E0C9B3 /* PBXContainerItemProxy */;
397+
sourceTree = BUILT_PRODUCTS_DIR;
398+
};
399+
4B512130211F395B00E0C9B3 /* Reachability.framework */ = {
400+
isa = PBXReferenceProxy;
401+
fileType = wrapper.framework;
402+
path = Reachability.framework;
403+
remoteRef = 4B51212F211F395B00E0C9B3 /* PBXContainerItemProxy */;
404+
sourceTree = BUILT_PRODUCTS_DIR;
405+
};
406+
4B512132211F395B00E0C9B3 /* share.framework */ = {
407+
isa = PBXReferenceProxy;
408+
fileType = wrapper.framework;
409+
path = share.framework;
410+
remoteRef = 4B512131211F395B00E0C9B3 /* PBXContainerItemProxy */;
411+
sourceTree = BUILT_PRODUCTS_DIR;
412+
};
413+
4B512134211F395B00E0C9B3 /* shared_preferences.framework */ = {
414+
isa = PBXReferenceProxy;
415+
fileType = wrapper.framework;
416+
path = shared_preferences.framework;
417+
remoteRef = 4B512133211F395B00E0C9B3 /* PBXContainerItemProxy */;
418+
sourceTree = BUILT_PRODUCTS_DIR;
419+
};
420+
4B512136211F395B00E0C9B3 /* sqflite.framework */ = {
421+
isa = PBXReferenceProxy;
422+
fileType = wrapper.framework;
423+
path = sqflite.framework;
424+
remoteRef = 4B512135211F395B00E0C9B3 /* PBXContainerItemProxy */;
425+
sourceTree = BUILT_PRODUCTS_DIR;
426+
};
427+
4B512138211F395B00E0C9B3 /* url_launcher.framework */ = {
428+
isa = PBXReferenceProxy;
429+
fileType = wrapper.framework;
430+
path = url_launcher.framework;
431+
remoteRef = 4B512137211F395B00E0C9B3 /* PBXContainerItemProxy */;
432+
sourceTree = BUILT_PRODUCTS_DIR;
433+
};
434+
/* End PBXReferenceProxy section */
435+
204436
/* Begin PBXResourcesBuildPhase section */
205437
97C146EC1CF9000F007C117D /* Resources */ = {
206438
isa = PBXResourcesBuildPhase;
@@ -453,6 +685,7 @@
453685
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
454686
CLANG_ENABLE_MODULES = YES;
455687
CURRENT_PROJECT_VERSION = 1;
688+
DEVELOPMENT_TEAM = B29J9885S3;
456689
ENABLE_BITCODE = NO;
457690
FRAMEWORK_SEARCH_PATHS = (
458691
"$(inherited)",
@@ -464,7 +697,7 @@
464697
"$(inherited)",
465698
"$(PROJECT_DIR)/Flutter",
466699
);
467-
PRODUCT_BUNDLE_IDENTIFIER = com.shuyu.gsygithub.gsyGithubAppFlutter;
700+
PRODUCT_BUNDLE_IDENTIFIER = com.shuyu.GSYGithubAppFlutter;
468701
PRODUCT_NAME = "$(TARGET_NAME)";
469702
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
470703
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -481,6 +714,7 @@
481714
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
482715
CLANG_ENABLE_MODULES = YES;
483716
CURRENT_PROJECT_VERSION = 1;
717+
DEVELOPMENT_TEAM = B29J9885S3;
484718
ENABLE_BITCODE = NO;
485719
FRAMEWORK_SEARCH_PATHS = (
486720
"$(inherited)",
@@ -492,7 +726,7 @@
492726
"$(inherited)",
493727
"$(PROJECT_DIR)/Flutter",
494728
);
495-
PRODUCT_BUNDLE_IDENTIFIER = com.shuyu.gsygithub.gsyGithubAppFlutter;
729+
PRODUCT_BUNDLE_IDENTIFIER = com.shuyu.GSYGithubAppFlutter;
496730
PRODUCT_NAME = "$(TARGET_NAME)";
497731
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
498732
SWIFT_SWIFT3_OBJC_INFERENCE = On;

ios/Runner/Info.plist

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>GSYGithubAppFlutter</string>
79
<key>CFBundleExecutable</key>
810
<string>$(EXECUTABLE_NAME)</string>
911
<key>CFBundleIdentifier</key>
@@ -23,11 +25,11 @@
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
2527
<key>NSAppTransportSecurity</key>
26-
<dict>
27-
<key>NSAllowsArbitraryLoads</key>
28-
<true/>
29-
<key>NSAllowsArbitraryLoadsInWebContent</key>
30-
<true/>
28+
<dict>
29+
<key>NSAllowsArbitraryLoads</key>
30+
<true/>
31+
<key>NSAllowsArbitraryLoadsInWebContent</key>
32+
<true/>
3133
<key>NSExceptionDomains</key>
3234
<dict>
3335
<key>localhost</key>
@@ -36,7 +38,7 @@
3638
<true/>
3739
</dict>
3840
</dict>
39-
</dict>
41+
</dict>
4042
<key>UILaunchStoryboardName</key>
4143
<string>LaunchScreen</string>
4244
<key>UIMainStoryboardFile</key>

lib/common/ab/SqlManager.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:io';
23

34
import 'package:sqflite/sqflite.dart';
45

@@ -20,6 +21,9 @@ class SqlManager {
2021
// open the database
2122
var databasesPath = await getDatabasesPath();
2223
String path = databasesPath + _NAME;
24+
if (Platform.isIOS) {
25+
path = databasesPath + "/" + _NAME;
26+
}
2327
_database = await openDatabase(path, version: _VERSION, onCreate: (Database db, int version) async {
2428
// When creating the db, create the table
2529
//await db.execute("CREATE TABLE Test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, num REAL)");

0 commit comments

Comments
 (0)