Commit 2ee82783 authored by rockypzhang's avatar rockypzhang

升级到flutter 2

parent 53b6fdb2
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="FrameworkDetectionExcludesConfiguration">
<type id="android" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectType">
<option name="id" value="io.flutter" />
......
......@@ -34,6 +34,6 @@ android {
}
dependencies {
//compile 'com.tencent.bugly:crashreport:latest.release'
implementation files('libs/bugly_crash_release.jar')
implementation 'com.tencent.bugly:crashreport:3.3.92'
implementation 'com.tencent.bugly:nativecrashreport:3.9.0'
}
\ No newline at end of file
......@@ -113,13 +113,19 @@ public class BuglyCrashPlugin implements MethodCallHandler {
BuglyCrashPluginLog.d("userKey:"+userKey+" userValue:"+userValue);
}else if (call.method.contains("log")){
buglyLog(call);
}else if (call.method.contains("setIsDevelopmentDevice")){
boolean isDevelopmentDevice = false;
if (call.hasArgument("isDevelopmentDevice")) {
isDevelopmentDevice = call.argument("isDevelopmentDevice");
}else if (call.method.contains("setServerUrl")){
String url = "";
if (call.hasArgument("url")) {
url = call.argument("url");
CrashReport.setServerUrl(url);
}
BuglyCrashPluginLog.d("url:"+url);
}else if (call.method.contains("setDeviceId")){
String deviceId = "";
if (call.hasArgument("deviceId")) {
deviceId = call.argument("deviceId");
CrashReport.setDeviceId(mContext,deviceId);
}
CrashReport.setIsDevelopmentDevice(mContext, isDevelopmentDevice);
BuglyCrashPluginLog.d("isDevelopmentDevice:"+isDevelopmentDevice);
} else {
result.notImplemented();
}
......
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"bugly_crash","path":"/Users/zhhp1121/zhp/project/as/flutter/Bugly-Flutter-Plugin/","dependencies":[]}],"android":[{"name":"bugly_crash","path":"/Users/zhhp1121/zhp/project/as/flutter/Bugly-Flutter-Plugin/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"bugly_crash","dependencies":[]}],"date_created":"2021-05-28 19:16:04.625405","version":"2.2.1"}
\ No newline at end of file
......@@ -32,5 +32,8 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.tencent.bugly.bugly_crash_example;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
org.gradle.jvmargs=-Xmx1536M
android.enableJetifier=true
android.useAndroidX=true
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/zhhp1121/zhp/flutter/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/zhhp1121/zhp/project/as/flutter/Bugly-Flutter-Plugin/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
......@@ -10,62 +10,29 @@ project 'Runner', {
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
}
return pods_ary
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
flutter_ios_podfile_setup
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
pod 'Bugly'
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
flutter_additional_ios_build_settings(target)
end
end
PODS:
- Bugly (2.5.0)
- Bugly (2.5.90)
- bugly_crash (0.0.1):
- Bugly
- Flutter
- Flutter (1.0.0)
DEPENDENCIES:
- Bugly
- bugly_crash (from `.symlinks/plugins/bugly_crash/ios`)
- Flutter (from `.symlinks/flutter/ios`)
- Flutter (from `Flutter`)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- Bugly
EXTERNAL SOURCES:
bugly_crash:
:path: ".symlinks/plugins/bugly_crash/ios"
Flutter:
:path: ".symlinks/flutter/ios"
:path: Flutter
SPEC CHECKSUMS:
Bugly: 3ca9f255c01025582df26f9222893b383c7e4b4e
bugly_crash: b528f0f01b0034fec1973568e8ed39e640d734f3
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
Bugly: 88bc32c0acc6fef7b74d610f0319ee7560d6b9fe
bugly_crash: 31637fa9ecaec38e1287afe5687c575c6e912ef3
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
PODFILE CHECKSUM: 9e01bf1cd72782c72804195fc2404be54f11b302
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
COCOAPODS: 1.7.1
COCOAPODS: 1.10.1
......@@ -9,11 +9,7 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6E7A17792257DAC337A5F73E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D101F8DF40C534265D7CCDEC /* libPods-Runner.a */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
......@@ -29,8 +25,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -41,14 +35,12 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
7C3C05A7A83AF68D97DE093B /* 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>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
......@@ -65,8 +57,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
6E7A17792257DAC337A5F73E /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -88,9 +78,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
......@@ -163,7 +151,6 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
A0E05FA2A55187C9C90BEFBC /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -234,7 +221,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
4723676552AEEAE9DFE1A437 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
......@@ -272,24 +259,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
A0E05FA2A55187C9C90BEFBC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
......@@ -327,7 +296,6 @@
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
......@@ -399,7 +367,6 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
......@@ -453,7 +420,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
......
......@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
......@@ -5,19 +5,20 @@ import 'package:flutter/services.dart';
import 'package:bugly_crash/bugly.dart';
import 'package:bugly_crash/buglyLog.dart';
import 'dart:io';
//void main() => runApp(MyApp());
Map<String,String> extraInfo = {"key1":"value1","key2":"value2","key3":"value1"};
Future<Null> main() async {
//测试APP未捕获到的异常上报
//一、这里配置上报APP未捕获到的异常,业务可以自由决定上报的信息
FlutterError.onError = (FlutterErrorDetails details) async {
print("zone current print error");
Zone.current.handleUncaughtError(details.exception, details.stack);
Zone.current.handleUncaughtError(details.exception, details.stack!);
};
runZoned<Future<Null>>(() async {
runZonedGuarded<Future<Null>>(() async {
runApp(MyApp());
}, onError: (error, stackTrace) async {
}, (error, stackTrace) async {
String type = "flutter uncaught error";
await Bugly.postException(type:type,error: error.toString(),stackTrace: stackTrace.toString(),extraInfo:extraInfo);
});
......@@ -44,11 +45,14 @@ class _MyAppState extends State<MyApp> {
}
void initBuglyAndroid(){
//Bugly.setAndroidServerUrl(url: "https://xxxx");
Bugly.initAndroidCrashReport(appId:"c50a711298",isDebug: true);
Bugly.setUserId(userId:"androiduser");
//如果遇到AndroidId采集隐私问题,可以参考https://github.com/BuglyDevTeam/Bugly-Android-Demo
Bugly.setAndroidDeviceId(deviceId: "test");
Bugly.setUserSceneTag(userSceneTag: 111437);
Bugly.setIsDevelopmentDevice(isDevelopmentDevice: true);
Bugly.setAppVersion(appVersion:"1.9.3");
Bugly.setAndroidAppChannel(appChannel: "test");
//bugly自定义日志,可在"跟踪日志"页面查看
BuglyLog.d(tag:"bugly",content:"debugvalue");
BuglyLog.i(tag:"bugly",content:"infovalue");
......@@ -65,7 +69,6 @@ class _MyAppState extends State<MyApp> {
Bugly.setUserSceneTag(userSceneTag: 116852);
Bugly.setAppVersion(appVersion:"1.9.2");
Bugly.putUserData(userKey:"userkey1",userValue:"uservalue1");
Bugly.putUserData(userKey:"userkey2",userValue:"uservalue2");
Bugly.setUserId(userId:"iosuser");
BuglyLog.d(tag:"bugly",content:"debugvalue");
BuglyLog.i(tag:"bugly",content:"infovalue");
......@@ -84,17 +87,20 @@ class _MyAppState extends State<MyApp> {
platformVersion = 'Failed to get platform version.';
}
//测试APP自己捕获到的异常上报
//(1)测试APP自己捕获到的异常上报
try {
String s ;
s.trim();
var list = [1,2];
list[3] = 1;
} catch (e){
String type = "flutter caught error";
await Bugly.postException(type:type,error:"null exception",stackTrace:e.toString(),extraInfo:extraInfo);
}
//测试APP未捕获到的异常上报
//(2)测试APP未捕获到的异常上报
//throw 'bugly flutter uncaught error test';
var list = [1,2];
list[3] = 1;
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
......
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "2.1.0"
bugly_crash:
dependency: "direct dev"
description:
......@@ -22,27 +22,48 @@ packages:
relative: true
source: path
version: "0.0.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.11"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.2"
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
......@@ -57,37 +78,23 @@ packages:
dependency: transitive
description:
name: matcher
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.5"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
source: hosted
version: "1.6.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
source: hosted
version: "2.0.2"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
......@@ -97,57 +104,58 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.5"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.3.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.2.0"
......@@ -3,7 +3,10 @@ description: Demonstrates how to use the bugly_crash plugin.
publish_to: 'none'
environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
# Flutter versions prior to 1.12 did not support the
# flutter.plugin.platforms map.
flutter: ">=2.2.0"
dependencies:
flutter:
......
#import "BuglyCrashPlugin.h"
#import <Bugly/Bugly.h>
#import <Bugly/BuglyLog.h>
@implementation BuglyCrashPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
......
......@@ -8,9 +8,9 @@ Pod::Spec.new do |s|
s.description = <<-DESC
bugly crash plugin
DESC
s.homepage = 'http://example.com'
s.homepage = 'http://www.tencent.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.author = { 'tencent' => 'rockypzhang@tencent.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
......
......@@ -3,7 +3,7 @@ import 'dart:io';
import 'package:flutter/services.dart';
/**
* Description:bugly oa futter plugin .
* Description:bugly futter plugin .
* @author rockypzhang
* @since 2019/5/28
*/
......@@ -22,10 +22,10 @@ class Bugly {
* @param isDebug 是否打开debug开关
*/
static Future<void> initAndroidCrashReport({
String appId,
bool isDebug,
String? appId,
bool? isDebug,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"appId": appId,
"isDebug":isDebug,
};
......@@ -33,39 +33,18 @@ class Bugly {
}
/**
* 初始化接口.
* @param appId appId
* 自定义上报域名.
* @param url 自定义域名
*/
static Future<void> initIosCrashReport({
String appId,
static Future<void> setAndroidServerUrl({
String? url,
}) async{
Map<String, Object> map = {
"appId": appId,
if(Platform.isAndroid){
Map<String, Object?> map = {
"url": url,
};
_channel.invokeMethod("initCrashReport",map);
_channel.invokeMethod("setServerUrl",map);
}
/**
* 上报自定义异常.
*
* @param type 错误类型
* @param error 错误信息
* @param stackTrace 出错堆栈
* @param extraInfo 额外信息
*/
static Future<void> postException({
String type,
String error,
String stackTrace,
Map<String,String> extraInfo,
}) async{
Map<String, Object> map = {
"type":type,
"error":error,
"stackTrace":stackTrace,
"extraInfo":extraInfo,
};
_channel.invokeMethod("postException",map);
}
/**
......@@ -73,11 +52,11 @@ class Bugly {
*
* @param appChannel App渠道
*/
static Future<void> setAppChannel({
String appChannel,
static Future<void> setAndroidAppChannel({
String? appChannel,
}) async{
if(Platform.isAndroid){
Map<String, Object> map = {
Map<String, Object?> map = {
"appChannel":appChannel,
};
_channel.invokeMethod("setAppChannel",map);
......@@ -89,26 +68,78 @@ class Bugly {
*
* @param appPackage App包名
*/
static Future<void> setAppPackage({
String appPackage,
static Future<void> setAndroidAppPackage({
String? appPackage,
}) async{
if(Platform.isAndroid){
Map<String, Object> map = {
Map<String, Object?> map = {
"appPackage":appPackage,
};
_channel.invokeMethod("setAppPackage",map);
}
}
/**
* 设置App 设备 id
*
* @param appPackage App包名
*/
static Future<void> setAndroidDeviceId({
String? deviceId,
}) async{
if(Platform.isAndroid){
Map<String, Object?> map = {
"deviceId":deviceId,
};
_channel.invokeMethod("setDeviceId",map);
}
}
/**
* 初始化接口.
* @param appId appId
*/
static Future<void> initIosCrashReport({
String? appId,
}) async{
Map<String, Object?> map = {
"appId": appId,
};
_channel.invokeMethod("initCrashReport",map);
}
/**
* 上报自定义异常.
*
* @param type 错误类型
* @param error 错误信息
* @param stackTrace 出错堆栈
* @param extraInfo 额外信息
*/
static Future<void> postException({
String? type,
String? error,
String? stackTrace,
Map<String,String>? extraInfo,
}) async{
Map<String, Object?> map = {
"type":type,
"error":error,
"stackTrace":stackTrace,
"extraInfo":extraInfo,
};
_channel.invokeMethod("postException",map);
}
/**
* 设置App版本
*
* @param appVersion App版本
*/
static Future<void> setAppVersion({
String appVersion,
String? appVersion,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"appVersion":appVersion,
};
_channel.invokeMethod("setAppVersion",map);
......@@ -120,9 +151,9 @@ class Bugly {
* @param userSceneTag 唯一标识一种场景,必须大于0
*/
static Future<void> setUserSceneTag({
int userSceneTag,
int? userSceneTag,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"userSceneTag":userSceneTag,
};
_channel.invokeMethod("setUserSceneTag",map);
......@@ -134,9 +165,9 @@ class Bugly {
* @param userSceneTag 唯一标识一种场景,必须大于0
*/
static Future<void> setUserId({
String userId,
String? userId,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"userId":userId,
};
_channel.invokeMethod("setUserId",map);
......@@ -149,29 +180,14 @@ class Bugly {
* @param userValue 用户数据value
*/
static Future<void> putUserData({
String userKey,
String userValue,
String? userKey,
String? userValue,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"userKey":userKey,
"userValue":userValue,
};
_channel.invokeMethod("putUserData",map);
}
/**
* 设置开发设备(Development Device).
* @param isDevelopmentDevice true表示是开发设备,false表示非开发设备
*/
static Future<void> setIsDevelopmentDevice({
bool isDevelopmentDevice,
}) async{
if(Platform.isAndroid){
Map<String, Object> map = {
"isDevelopmentDevice":isDevelopmentDevice,
};
_channel.invokeMethod("setIsDevelopmentDevice",map);
}
}
}
......@@ -6,10 +6,10 @@ class BuglyLog {
const MethodChannel('bugly');
static Future<void> d({
String tag,
String content,
String? tag,
String? content,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"tag":tag,
"content":content,
};
......@@ -17,10 +17,10 @@ class BuglyLog {
}
static Future<void> i({
String tag,
String content,
String? tag,
String? content,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"tag":tag,
"content":content,
};
......@@ -28,10 +28,10 @@ class BuglyLog {
}
static Future<void> v({
String tag,
String content,
String? tag,
String? content,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"tag":tag,
"content":content,
};
......@@ -39,10 +39,10 @@ class BuglyLog {
}
static Future<void> w({
String tag,
String content,
String? tag,
String? content,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"tag":tag,
"content":content,
};
......@@ -50,10 +50,10 @@ class BuglyLog {
}
static Future<void> e({
String tag,
String content,
String? tag,
String? content,
}) async{
Map<String, Object> map = {
Map<String, Object?> map = {
"tag":tag,
"content":content,
};
......
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.11"
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
......@@ -43,37 +64,23 @@ packages:
dependency: transitive
description:
name: matcher
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.5"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
source: hosted
version: "1.6.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
source: hosted
version: "2.0.2"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
......@@ -83,57 +90,58 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.5"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.3.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://dart-pub.mirrors.sjtug.sjtu.edu.cn/"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.2.0"
name: bugly_crash
description: bugly crash plugin
version: 0.0.1
author:
homepage:
author: rockypzhang
homepage: https://bugly.qq.com
environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
# Flutter versions prior to 1.12 did not support the
# flutter.plugin.platforms map.
flutter: ">=2.2.0"
dependencies:
flutter:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment