Problem 1.上传App Store构建版本,上传成功,App Store Connect并不显示构建版本?
权限未配置齐全
升到iOS10之后,需要设置权限的有:
麦克风权限:Privacy - Microphone Usage Description 是否允许此App使用你的麦克风?
相机权限: Privacy - Camera Usage Description 是否允许此App使用你的相机?
相册权限: Privacy - Photo Library Usage Description 是否允许此App访问你的媒体资料库?
通讯录权限: Privacy - Contacts Usage Description 是否允许此App访问你的通讯录?
蓝牙权限:Privacy - Bluetooth Peripheral Usage Description 是否许允此App使用蓝牙?
语音转文字权限:Privacy - Speech Recognition Usage Description 是否允许此App使用语音识别?
日历权限:Privacy - Calendars Usage Description
定位权限:Privacy - Location When In Use Usage Description
定位权限: Privacy - Location Always Usage Description
位置权限:Privacy - Location Usage Description
媒体库权限:Privacy - Media Library Usage Description
健康分享权限:Privacy - Health Share Usage Description
健康更新权限:Privacy - Health Update Usage Description
运动使用权限:Privacy - Motion Usage Description
音乐权限:Privacy - Music Usage Description
提醒使用权限:Privacy - Reminders Usage Description
Siri使用权限:Privacy - Siri Usage Description
电视供应商使用权限:Privacy - TV Provider Usage Description
视频用户账号使用权限:Privacy - Video Subscriber Account Usage Description
Problem 2.上传App Store构建版本,上传成功,App Store Connect显示正在处理中,过一会版消失?
工程中引用权限插件有问题 预估为私有api访问 去除插件上传成功
权限处理插件
permission_handler: 2.1.2
提交应用到iTunes Connect时构建版本“正在处理”后直接消失——此构建版本无效
Problem 3.Flutter不在代码中设置不能抓包?
Problem 4.Error: Expected an identifier, but got ''. const
flutter clean
Problem 5.Flutter杂症( flutter packages pub run build_runner build )
--delete-conflicting-outputs
//清除之前生成的文件,如果直接运行下面的不行。可以先尝试运行这个
flutter packages pub run build_runner clean
//可以直接运行这个
flutter packages pub run build_runner build --delete-conflicting-outputs
Flutter杂症( flutter packages pub run build_runner build )
Problem 6.Flutter SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = 127.0.0.1, port = 0
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
I/flutter ( 7011): Observatory server failed to start after 1 tries
I/flutter ( 7011): Observatory server failed to start after 2 tries
I/flutter ( 7011): Observatory server failed to start after 3 tries
I/flutter ( 7011): Observatory server failed to start after 4 tries
I/flutter ( 7011): Observatory server failed to start after 5 tries
I/flutter ( 7011): Observatory server failed to start after 6 tries
I/flutter ( 7011): Observatory server failed to start after 7 tries
I/flutter ( 7011): Observatory server failed to start after 8 tries
I/flutter ( 7011): Observatory server failed to start after 9 tries
I/flutter ( 7011): Observatory server failed to start after 10 tries
I/flutter ( 7011): Observatory server failed to start after 11 tries
I/flutter ( 7011): Could not start Observatory HTTP server:
I/flutter ( 7011): SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = 127.0.0.1, port = 0
I/flutter ( 7011): #0 _NativeSocket.bind (dart:io/runtime/bin/socket_patch.dart:591:7)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #1 _RawServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1206:26)
I/flutter ( 7011): #2 _ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1466:29)
I/flutter ( 7011): #3 ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1457:26)
I/flutter ( 7011): #4 _HttpServer.bind (dart:_http/http_impl.dart:2520:25)
I/flutter ( 7011): #5 HttpServer.bind (dart:_http/http.dart:227:19)
I/flutter ( 7011): #6 Server.startup.poll (dart:vmservice_io/server.dart:355:36)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #7 Server.startup (dart:vmservice_io/server.dart:367:23)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #8 main (dart:vmservice_io/vmservice_io.dart:253:12)
I/flutter ( 7011):
在android工程AndroidManifest.xml配置
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Problem 6.Flutter在安卓部分真机上不显示图标(显示为flutter icon)
安卓系统图标缓存问题 切换主题即可 (究极大法:出厂重置)
Problem 7.Flutter项目中在代码端判断当前运行模式并取不同的url地址
static String initHost() {
const String inProduction = const String.fromEnvironment("dart.vm.product");
if (inProduction == "true") {
// 线上地址
} else if (inProduction == "false") {
// 线下地址
} else {
// 测试地址
}
}
Problem 8.如何将Flutter应用程序迁移到AndroidX
Flutter应用程序迁移到AndroidX
https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility
Problem 9.
Building App.framework for arm64...
Building AOT snapshot in release mode (ios-release)... 33.2s
Built to build/aot/.
Snapshotting (IOSArch.armv7) exited with non-zero exit code: 1
Snapshotting (IOSArch.arm64) exited with non-zero exit code: 0
cp: build/aot/App.framework: No such file or directory
error: cannot parse the debug map for 'build/aot/App.framework/App': No such file or directory
Failed to generate debug symbols (dSYM) file for build/aot/App.framework/App.
在之前版本构建flutter是成功的,但是我在升级Xcode11-beta macOS10.15时构建发生过以上错误
解决:Xcode-Architectures-Valid Architectures- armv7
Problem 10.Flutter打包iOS上传App Store报错是因为framework 包含了x86_64, i386 架构,这个是苹果不允许的
App Store Connect Operation Error
Communication error. Please use diagnostic mode to check connectivity. You need to have outbound access to TCP port 443.
App Store Connect Operation Error
ERROR ITMS-90087: "Unsupported Architectures. The executable for Runner.app/Frameworks/Flutter.framework contains unsupported architectures '[x86_64]'."
App Store Connect Operation Error
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'Runner.app/Frameworks/Flutter.framework/Flutter' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
App Store Connect Operation Error
ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
App Store Connect Operation Warning
WARNING ITMS-90080: "The executable 'Payload/Runner.app/Frameworks/Flutter.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
Problem 11.如果Flutter检测到您的项目不支持Xcode 11.4及其以上,则可能会转到此。
https://flutter.dev/docs/development/ios-project-migration
Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator.
Building for iOS Simulator, but the linked and embedded framework 'App.framework' was built for iOS.
根据文档提示进行就可以,在这里我要提醒注意两点,
1.删除App.framework 和Flutter.framework 不要彻底删除,删除引用即可
2.第五步,如果已经存在Flutter 或者 "Flutter" 不需要执行这一步
Problem 12. Flutter升级v2.0
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;"> Undefined symbols for architecture x86_64:
"___gxx_personality_v0", referenced from:
+[FlutterSound registerWithRegistrar:] in flutter_sound_lite(FlutterSound.o)
+[FlutterSoundPlayerManager registerWithRegistrar:] in flutter_sound_lite(FlutterSoundPlayerManager.o)
-[FlutterSoundPlayerManager init] in flutter_sound_lite(FlutterSoundPlayerManager.o)
FlutterSoundPlayerReg(NSObject<FlutterPluginRegistrar>*) in flutter_sound_lite(FlutterSoundPlayerManager.o)
-[FlutterSoundPlayerManager handleMethodCall:result:] in flutter_sound_lite(FlutterSoundPlayerManager.o)
-[FlutterSoundPlayer startPlayerCompleted:duration:] in flutter_sound_lite(FlutterSoundPlayer.o)
-[FlutterSoundPlayer needSomeFood:] in flutter_sound_lite(FlutterSoundPlayer.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
</pre>
|
解决:因为里面有用到C++ 的一些东西。Xcode中Build Phases->link Binary with Libraries中添加libc++.tbd
Problem 13.Android复制手机号失败、点击电话失败**
机型:华为 P30 pro Harmony OS 2.0.0 吴艳军
解决:Android原生调用
|
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;">/**
- 打电话
*/
public void linkTelephone(MethodCall call, MethodChannel.Result result) {
String telephone = (String) call.arguments;
Intent intent = new Intent(Intent.ACTION_DIAL);
Uri data = Uri.parse("tel:" + telephone);
intent.setData(data);
startActivity(intent);
result.success(true);
}</pre>
|
Problem 14.Android拍照无反应**
机型:vivoi S6、vivo iQOO Z1、OPPO A93s(Color OS V11.1 Android 11)、一加8T
解决:Android原生调用
|
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;">/**
- 拍照功能
*/
public void takePhoto(MethodCall call, MethodChannel.Result result) {
Intent intent = new Intent();
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
mPhoneUri = getPhotoName();
intent.putExtra(MediaStore.EXTRA_OUTPUT, mPhoneUri);
startActivityForResult(intent, CAMERA_PHOTO);
currentResult = result;
}</pre>
|
Problem 15 .Android点击导航,没有自动打开地图**
机型:努比亚nx659j
解决:适配Android11系统,配置相关地图包名
|
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;">
<queries>
<package android:name="com.autonavi.minimap" />
<package android:name="com.baidu.BaiduMap" />
<package android:name="com.tencent.map" />
</queries></pre>
|
Problem 16.百度地图获取定位失败、超时**
解决:百度地图定位多次后失效,每次定位重新初始化定位对象。建议使用最新3.0空安全版本
12.Andorid百度地图搜索位置失效
解决:退出App时,杀死App进程。
|
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;"> @Override
protected void onDestroy() {
super.onDestroy();
// 退出App
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}</pre>
|
Problem 18.Andorid百度地图搜索位置失效,错误信息如下。**
|
<pre style="margin: 0px; tab-size: 4; white-space: pre-wrap;">E/baidumapsdk(22666): Authentication Error
E/baidumapsdk(22666): =============================================
E/baidumapsdk(22666): ----------------- 鉴权错误信息 ------------
E/baidumapsdk(22666): sha1;package:9A:B9:A8:3F:79:BD:0F:F9:85:4C:06:45:46:7B:6B:3D:3F:78:F9:BF;com.huimin.crm
E/baidumapsdk(22666): key:gRhkr8VG2hdseXufqfPGuNyRMGGtkKcI
E/baidumapsdk(22666): errorcode: -11 uid: -1 appid -1 msg: httpsPost failed,IOException:java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
E/baidumapsdk(22666): 请仔细核查 SHA1、package与key申请信息是否对应,key是否删除,平台是否匹配
E/baidumapsdk(22666): errorcode为230时,请参考论坛链接:
E/baidumapsdk(22666): http://bbs.lbsyun.baidu.com/forum.php?mod=viewthread&tid=106461
E/baidumapsdk(22666): =============================================</pre>
|
原因:开代理,百度地图接口不允许抓包
解决:使用百度API关闭手机代理
15.iOS企业包安装无法验证App。
一:证书或者配置文件过期
解决方案:
打开苹果开发者后台,登录企业账号,检查证书与配置文件是否过期。
二:网络问题(无网络连接或网络信号弱)
解决方案:
1.检查设备是否有网络连接(打开浏览器,随便打开一个网页,能正常打开即网络正常)
2.查看app是否允许网络连接(设置->蜂窝网络->找到不app→WLAN与蜂窝网络)
3.切换网络运营商(比如:如果是电信4G无法验证app,那么使用移动的网或者联动的网再进行尝试)
4.移动位置
三:设备问题(确保不是越狱设备)
解决方案:使用非越狱设备安装app
四:系统问题(某些系统版本不稳定)
解决方案: 升级系统至最新版本(请确保系统是正式版本,而不是beta版本)
五.其他问题(优先)
解决方案:
(1)关闭网络;重启手机;重新开启网络。
(2 ) 关闭网络;打开设置->下滑找到Safari浏览器->点击进去,找到清除历史记录与网站数据->点击后等待一段时间,等文本重新变成蓝色就是清除好了;重新开启网络