x1ongzhu 6 лет назад
Родитель
Сommit
43b7aed5a4

+ 1 - 1
android/app/build.gradle

@@ -45,7 +45,7 @@ android {
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         ndk {
-            abiFilters 'armeabi-v7a'
+            // abiFilters 'armeabi-v7a'
         }
         manifestPlaceholders = [
                 JPUSH_PKGNAME: applicationId,

+ 2 - 2
android/build.gradle

@@ -1,12 +1,12 @@
 buildscript {
-    ext.kotlin_version = '1.2.71'
+    ext.kotlin_version = '1.3.31'
     repositories {
         google()
         jcenter()
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.2.1'
+        classpath 'com.android.tools.build:gradle:3.3.0'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }

+ 2 - 0
android/gradle.properties

@@ -1 +1,3 @@
 org.gradle.jvmargs=-Xmx1536M
+android.enableJetifier=true
+android.useAndroidX=true

+ 13 - 6
lib/main.dart

@@ -6,6 +6,7 @@ import 'package:redux/redux.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import 'package:shared_preferences/shared_preferences.dart';
+import 'package:flutter_bugly/flutter_bugly.dart';
 import './Localizations.dart';
 import 'model/UserInfo.dart';
 import 'net/HttpManager.dart';
@@ -43,12 +44,12 @@ class MobileCyberGamesApp extends StatelessWidget {
             textSelectionColor: Colors.white,
             textTheme: TextTheme(
               subhead: TextStyle(color: Colors.white),
-              title:TextStyle(color: Colors.white),
+              title: TextStyle(color: Colors.white),
             ),
-            primaryTextTheme:TextTheme(
-               title:TextStyle(color: Colors.white),
+            primaryTextTheme: TextTheme(
+              title: TextStyle(color: Colors.white),
             ),
-            primaryIconTheme:IconThemeData(color: Colors.white),
+            primaryIconTheme: IconThemeData(color: Colors.white),
             buttonTheme: ButtonThemeData(
               buttonColor: Color(0xFFC2524D),
               highlightColor: Color(0xFF8E3B36),
@@ -83,8 +84,14 @@ Future<void> main() async {
   if (result.success && result.data != null) {
     UserInfo userInfo = UserInfo.fromJson(result.data);
     state.userInfo = userInfo;
+     FlutterBugly.setUserId("user id");
     // jpush.setAlias(userInfo.id.toString()).then((map) {});
   }
-  Store<AppState> store = Store<AppState>(appReducer, initialState: state);
-  runApp(MobileCyberGamesApp(store));
+  final Store<AppState> store = Store<AppState>(appReducer, initialState: state);
+
+  FlutterBugly.postCatchedException(() {
+    runApp(MobileCyberGamesApp(store));
+  });
+
+  FlutterBugly.init(androidAppId: 'bd9a511cb9', iOSAppId: '');
 }

+ 7 - 0
pubspec.lock

@@ -174,6 +174,13 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_bugly:
+    dependency: "direct main"
+    description:
+      name: flutter_bugly
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.2.2"
   flutter_localizations:
     dependency: "direct main"
     description: flutter

+ 1 - 0
pubspec.yaml

@@ -37,6 +37,7 @@ dependencies:
   path_provider: "^0.5.0+1"
   screen_stream_plugin:
     path: ./screen_stream_plugin
+  flutter_bugly: ^0.2.2
 
 dev_dependencies:
   build_runner: ^1.1.1

+ 1 - 1
screen_stream_plugin/android/src/main/java/com/izouma/screen_stream_plugin/ImageAvailableListener.java

@@ -74,7 +74,7 @@ public class ImageAvailableListener implements ImageReader.OnImageAvailableListe
 
                 Bitmap bitmap = Bitmap.createBitmap(1280, 720, Bitmap.Config.ARGB_8888);
                 bitmap.copyPixelsFromBuffer(buffer);
-                if (frameCount % 5 != 0) {
+                if (frameCount % 2 == 0) {
                     bitmap.recycle();
                     return;
                 }