diff --git a/android/app/build.gradle b/android/app/build.gradle index 50ff83a..a229930 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -79,6 +79,6 @@ flutter { source = "../.." } dependencies { - implementation 'com.github.gzu-liyujiang:Android_CN_OAID:4.2.9' + implementation 'com.github.gzu-liyujiang:Android_CN_OAID:4.2.11' } diff --git a/android/app/src/main/kotlin/cn/yooss/mood_diary/HandleGetOAID.kt b/android/app/src/main/kotlin/cn/yooss/mood_diary/HandleGetOAID.kt index 5ec4201..5b9364d 100644 --- a/android/app/src/main/kotlin/cn/yooss/mood_diary/HandleGetOAID.kt +++ b/android/app/src/main/kotlin/cn/yooss/mood_diary/HandleGetOAID.kt @@ -5,12 +5,11 @@ import io.flutter.plugin.common.MethodChannel import java.lang.Exception class HandleGetOAID(private var resultCallback: MethodChannel.Result) : IGetter { - override fun onOAIDGetComplete(result: String?) { - resultCallback.success(result); + override fun onOAIDGetComplete(result: String) { + resultCallback.success(result) } override fun onOAIDGetError(error: Exception?) { - - resultCallback.error("100", "error", error); + resultCallback.success(null) } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/cn/yooss/mood_diary/MainActivity.kt b/android/app/src/main/kotlin/cn/yooss/mood_diary/MainActivity.kt index ea5b344..dffbf2e 100644 --- a/android/app/src/main/kotlin/cn/yooss/mood_diary/MainActivity.kt +++ b/android/app/src/main/kotlin/cn/yooss/mood_diary/MainActivity.kt @@ -33,6 +33,8 @@ class MainActivity : FlutterFragmentActivity() { private fun getOAID(resultCallback: MethodChannel.Result) { if (DeviceID.supportedOAID(application)) { DeviceID.getOAID(application, HandleGetOAID(resultCallback)); + } else { + resultCallback.success(null) } } diff --git a/lib/main.dart b/lib/main.dart index 0f13a3d..8d05e26 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -71,12 +71,14 @@ void main() async { if (details.exceptionAsString().contains('Render')) { Utils().noticeUtil.showBug(message: '布局异常!'); } else { - Utils().noticeUtil.showBug(message: '出错了,请联系开发者!'); + //Utils().noticeUtil.showBug(message: 'error:${details.exception.toString()}\nstack:${details.stack?.toString()}'); + Utils().noticeUtil.showBug(message: '出错了,请联系开发者处理!'); } }; PlatformDispatcher.instance.onError = (error, stack) { Utils().logUtil.printWTF('Error', error: error, stackTrace: stack); - Utils().noticeUtil.showBug(message: '出错了,请联系开发者!'); + Utils().noticeUtil.showBug(message: '出错了,请联系开发者处理!'); + //Utils().noticeUtil.showBug(message: 'error:${error.toString()}\nstack:${stack.toString()}'); return true; }; runApp(GetMaterialApp( diff --git a/pubspec.lock b/pubspec.lock index 7c681c3..6dac781 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1566,10 +1566,10 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" package_info_plus: dependency: "direct main" description: @@ -1782,10 +1782,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.4" + version: "2.1.5" pubspec_parse: dependency: transitive description: