feat: Error with run android (#172)
@ -0,0 +1,28 @@ |
||||
# This file configures the analyzer, which statically analyzes Dart code to |
||||
# check for errors, warnings, and lints. |
||||
# |
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled |
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be |
||||
# invoked from the command line by running `flutter analyze`. |
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps, |
||||
# packages, and plugins designed to encourage good coding practices. |
||||
include: package:flutter_lints/flutter.yaml |
||||
|
||||
linter: |
||||
# The lint rules applied to this project can be customized in the |
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` |
||||
# included above or to enable additional rules. A list of all available lints |
||||
# and their documentation is published at https://dart.dev/lints. |
||||
# |
||||
# Instead of disabling a lint rule for the entire project in the |
||||
# section below, it can also be suppressed for a single line of code |
||||
# or a specific dart file by using the `// ignore: name_of_lint` and |
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file |
||||
# producing the lint. |
||||
rules: |
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule |
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
||||
|
||||
# Additional information about this file can be found at |
||||
# https://dart.dev/guides/language/analysis-options |
@ -1,69 +1,58 @@ |
||||
plugins { |
||||
id "com.android.application" |
||||
id "kotlin-android" |
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. |
||||
id "dev.flutter.flutter-gradle-plugin" |
||||
} |
||||
|
||||
def localProperties = new Properties() |
||||
def localPropertiesFile = rootProject.file('local.properties') |
||||
def localPropertiesFile = rootProject.file("local.properties") |
||||
if (localPropertiesFile.exists()) { |
||||
localPropertiesFile.withReader('UTF-8') { reader -> |
||||
localPropertiesFile.withReader("UTF-8") { reader -> |
||||
localProperties.load(reader) |
||||
} |
||||
} |
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk') |
||||
if (flutterRoot == null) { |
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
||||
} |
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
||||
def flutterVersionCode = localProperties.getProperty("flutter.versionCode") |
||||
if (flutterVersionCode == null) { |
||||
flutterVersionCode = '1' |
||||
flutterVersionCode = "1" |
||||
} |
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName') |
||||
def flutterVersionName = localProperties.getProperty("flutter.versionName") |
||||
if (flutterVersionName == null) { |
||||
flutterVersionName = '1.0' |
||||
flutterVersionName = "1.0" |
||||
} |
||||
|
||||
apply plugin: 'com.android.application' |
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
||||
|
||||
android { |
||||
compileSdkVersion 30 |
||||
namespace = "com.example.example" |
||||
compileSdk = flutter.compileSdkVersion |
||||
ndkVersion = flutter.ndkVersion |
||||
|
||||
compileOptions { |
||||
sourceCompatibility = JavaVersion.VERSION_1_8 |
||||
targetCompatibility = JavaVersion.VERSION_1_8 |
||||
} |
||||
|
||||
defaultConfig { |
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
||||
applicationId "io.openim.flutter_openim_sdk_example" |
||||
minSdkVersion 21 |
||||
targetSdkVersion 30 |
||||
versionCode flutterVersionCode.toInteger() |
||||
versionName flutterVersionName |
||||
applicationId = "com.example.example" |
||||
// You can update the following values to match your application needs. |
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. |
||||
minSdk = flutter.minSdkVersion |
||||
targetSdk = flutter.targetSdkVersion |
||||
versionCode = flutterVersionCode.toInteger() |
||||
versionName = flutterVersionName |
||||
} |
||||
|
||||
buildTypes { |
||||
debug { |
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
||||
} |
||||
release { |
||||
// TODO: Add your own signing config for the release build. |
||||
// Signing with the debug keys for now, so `flutter run --release` works. |
||||
// signingConfig signingConfigs.debug |
||||
|
||||
signingConfig signingConfigs.debug |
||||
|
||||
minifyEnabled false |
||||
shrinkResources false |
||||
|
||||
useProguard true |
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
||||
} |
||||
} |
||||
|
||||
repositories{ |
||||
flatDir { |
||||
dirs 'libs' |
||||
signingConfig = signingConfigs.debug |
||||
} |
||||
} |
||||
} |
||||
dependencies { |
||||
|
||||
} |
||||
flutter { |
||||
source '../..' |
||||
source = "../.." |
||||
} |
||||
|
@ -1,6 +0,0 @@ |
||||
package io.openim.flutter_openim_sdk_example; |
||||
|
||||
import io.flutter.embedding.android.FlutterActivity; |
||||
|
||||
public class MainActivity extends FlutterActivity { |
||||
} |
@ -0,0 +1,5 @@ |
||||
package com.example.example |
||||
|
||||
import io.flutter.embedding.android.FlutterActivity |
||||
|
||||
class MainActivity: FlutterActivity() |
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 11 KiB |
@ -1,3 +1,3 @@ |
||||
org.gradle.jvmargs=-Xmx1536M |
||||
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError |
||||
android.useAndroidX=true |
||||
android.enableJetifier=true |
||||
|
@ -1,6 +1,5 @@ |
||||
#Fri Jun 23 08:50:38 CEST 2017 |
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip |
||||
|
@ -1,107 +0,0 @@ |
||||
#默认的proguard-android.txt已经增加了Annotation、native、view的setget方法、Activity参数为view的 方法、Enum枚举、Parcelable、R,此处不再写 |
||||
#------------------------------------------通用区域---------------------------------------------------- |
||||
#----------------------基本指令------------------------ |
||||
-optimizationpasses 5 |
||||
-dontusemixedcaseclassnames |
||||
-dontskipnonpubliclibraryclasses |
||||
-dontskipnonpubliclibraryclassmembers |
||||
-dontpreverify |
||||
-verbose |
||||
-printmapping proguardMapping.txt |
||||
-optimizations !code/simplification/cast,!field/*,!class/merging/* |
||||
-keepattributes *Annotation*,InnerClasses |
||||
-keepattributes Signature |
||||
-keepattributes SourceFile,LineNumberTable |
||||
|
||||
#如果引用了v4或者v7包 |
||||
-dontwarn android.support.** |
||||
-keep class android.support.** { *; } |
||||
-keep interface android.support.** { *; } |
||||
-keep public class * extends android.support.** |
||||
-dontwarn android.support.** |
||||
|
||||
#如果引用了androidx包 |
||||
-keep class com.google.android.material.** {*;} |
||||
-keep class androidx.** {*;} |
||||
-keep public class * extends androidx.** |
||||
-keep interface androidx.** {*;} |
||||
-dontwarn com.google.android.material.** |
||||
-dontnote com.google.android.material.** |
||||
-dontwarn androidx.** |
||||
|
||||
#---------------------默认保留------------------------- |
||||
## 基础保留 ## |
||||
-keep public class * extends android.app.Fragment |
||||
-keep public class * extends android.app.Activity |
||||
-keep public class * extends android.app.Application |
||||
-keep public class * extends android.app.Service |
||||
-keep public class * extends android.content.BroadcastReceiver |
||||
-keep public class * extends android.content.ContentProvider |
||||
-keep public class * extends android.app.backup.BackupAgentHelper |
||||
-keep public class * extends android.preference.Preference |
||||
-keep public class com.android.vending.licensing.ILicensingService |
||||
|
||||
-keep public class * extends android.view.View { |
||||
public <init>(android.content.Context); |
||||
public <init>(android.content.Context, android.util.AttributeSet); |
||||
public <init>(android.content.Context, android.util.AttributeSet, int); |
||||
public void set*(...); |
||||
} |
||||
# 保持自定义控件类不被混淆 |
||||
-keepclasseswithmembers class * { |
||||
public <init>(android.content.Context, android.util.AttributeSet); |
||||
public <init>(android.content.Context, android.util.AttributeSet, int); |
||||
} |
||||
#保持自定义控件类不被混淆 |
||||
-keepclassmembers class * extends android.app.Activity { |
||||
public void *(android.view.View); |
||||
} |
||||
-keepclassmembers enum * { # 保持枚举 enum 类不被混淆 |
||||
public static **[] values(); |
||||
public static ** valueOf(java.lang.String); |
||||
} |
||||
-keep class * implements android.os.Parcelable { # 保持 Parcelable 不被混淆 |
||||
public static final android.os.Parcelable$Creator *; |
||||
} |
||||
-keep class * implements java.io.Serializable # 保持 Serializable 不被混淆 |
||||
#保持 Serializable 不被混淆并且enum 类也不被混淆 |
||||
-keepclassmembers class * implements java.io.Serializable { |
||||
static final long serialVersionUID; |
||||
private static final java.io.ObjectStreamField[] serialPersistentFields; |
||||
!static !transient <fields>; |
||||
!private <fields>; |
||||
!private <methods>; |
||||
private void writeObject(java.io.ObjectOutputStream); |
||||
private void readObject(java.io.ObjectInputStream); |
||||
java.lang.Object writeReplace(); |
||||
java.lang.Object readResolve(); |
||||
} |
||||
#不混淆资源类 |
||||
-keepclassmembers class **.R$* { |
||||
public static <fields>; |
||||
} |
||||
# 保持 native 方法不被混淆 |
||||
-keepclasseswithmembernames class * { |
||||
native <methods>; |
||||
} |
||||
|
||||
#WebView |
||||
-keepclassmembers class * extends android.webkit.WebView {*;} |
||||
-keepclassmembers class * extends android.webkit.WebViewClient {*;} |
||||
-keepclassmembers class * extends android.webkit.WebChromeClient {*;} |
||||
-keepclassmembers class * { |
||||
@android.webkit.JavascriptInterface <methods>; |
||||
} |
||||
|
||||
-keep class androidx.lifecycle.DefaultLifecycleObserver |
||||
#-------------------------------------------项目定义区------------------------------------------------- |
||||
#im |
||||
-keep class io.openim.flutter_openim_sdk.** { *; } |
||||
#Flutter Wrapper |
||||
#-dontwarn io.flutter.** |
||||
#-keep class io.flutter.app.** { *; } |
||||
#-keep class io.flutter.plugin.** { *; } |
||||
#-keep class io.flutter.util.** { *; } |
||||
#-keep class io.flutter.view.** { *; } |
||||
#-keep class io.flutter.** { *; } |
||||
#-keep class io.flutter.plugins.** { *; } |
@ -1,11 +1,25 @@ |
||||
include ':app' |
||||
pluginManagement { |
||||
def flutterSdkPath = { |
||||
def properties = new Properties() |
||||
file("local.properties").withInputStream { properties.load(it) } |
||||
def flutterSdkPath = properties.getProperty("flutter.sdk") |
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" |
||||
return flutterSdkPath |
||||
}() |
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties") |
||||
def properties = new Properties() |
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") |
||||
|
||||
assert localPropertiesFile.exists() |
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } |
||||
repositories { |
||||
google() |
||||
mavenCentral() |
||||
gradlePluginPortal() |
||||
} |
||||
} |
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk") |
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" |
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" |
||||
plugins { |
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0" |
||||
id "com.android.application" version "7.3.0" apply false |
||||
id "org.jetbrains.kotlin.android" version "1.7.10" apply false |
||||
} |
||||
|
||||
include ":app" |
||||
|
@ -1,29 +0,0 @@ |
||||
PODS: |
||||
- Flutter (1.0.0) |
||||
- flutter_openim_sdk (0.0.1): |
||||
- Flutter |
||||
- OpenIMSDKCore (= 3.8.1-rc.0) |
||||
- OpenIMSDKCore (3.8.1-rc.0) |
||||
|
||||
DEPENDENCIES: |
||||
- Flutter (from `Flutter`) |
||||
- flutter_openim_sdk (from `.symlinks/plugins/flutter_openim_sdk/ios`) |
||||
|
||||
SPEC REPOS: |
||||
trunk: |
||||
- OpenIMSDKCore |
||||
|
||||
EXTERNAL SOURCES: |
||||
Flutter: |
||||
:path: Flutter |
||||
flutter_openim_sdk: |
||||
:path: ".symlinks/plugins/flutter_openim_sdk/ios" |
||||
|
||||
SPEC CHECKSUMS: |
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 |
||||
flutter_openim_sdk: 754e4ad0177918ce2c37dfba63973db26ce89c90 |
||||
OpenIMSDKCore: 0c92e9e3eb2a91b6b6528e7781a1e28ed42bc518 |
||||
|
||||
PODFILE CHECKSUM: d4ba08011ff3d270b662299a448a7c436eb30089 |
||||
|
||||
COCOAPODS: 1.14.3 |
@ -1,103 +1,122 @@ |
||||
{ |
||||
"images" : [ |
||||
{ |
||||
"size" : "20x20", |
||||
"idiom" : "iphone", |
||||
"scale" : "2x", |
||||
"size" : "20x20" |
||||
"filename" : "Icon-App-20x20@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "20x20", |
||||
"idiom" : "iphone", |
||||
"scale" : "3x", |
||||
"size" : "20x20" |
||||
"filename" : "Icon-App-20x20@3x.png", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"size" : "29x29", |
||||
"idiom" : "iphone", |
||||
"scale" : "1x", |
||||
"size" : "29x29" |
||||
"filename" : "Icon-App-29x29@1x.png", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"size" : "29x29", |
||||
"idiom" : "iphone", |
||||
"scale" : "2x", |
||||
"size" : "29x29" |
||||
"filename" : "Icon-App-29x29@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "29x29", |
||||
"idiom" : "iphone", |
||||
"scale" : "3x", |
||||
"size" : "29x29" |
||||
"filename" : "Icon-App-29x29@3x.png", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"size" : "40x40", |
||||
"idiom" : "iphone", |
||||
"scale" : "2x", |
||||
"size" : "40x40" |
||||
"filename" : "Icon-App-40x40@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "40x40", |
||||
"idiom" : "iphone", |
||||
"scale" : "3x", |
||||
"size" : "40x40" |
||||
"filename" : "Icon-App-40x40@3x.png", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"size" : "60x60", |
||||
"idiom" : "iphone", |
||||
"scale" : "2x", |
||||
"size" : "60x60" |
||||
"filename" : "Icon-App-60x60@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "60x60", |
||||
"idiom" : "iphone", |
||||
"scale" : "3x", |
||||
"size" : "60x60" |
||||
"filename" : "Icon-App-60x60@3x.png", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"size" : "20x20", |
||||
"idiom" : "ipad", |
||||
"scale" : "1x", |
||||
"size" : "20x20" |
||||
"filename" : "Icon-App-20x20@1x.png", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"size" : "20x20", |
||||
"idiom" : "ipad", |
||||
"scale" : "2x", |
||||
"size" : "20x20" |
||||
"filename" : "Icon-App-20x20@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "29x29", |
||||
"idiom" : "ipad", |
||||
"scale" : "1x", |
||||
"size" : "29x29" |
||||
"filename" : "Icon-App-29x29@1x.png", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"size" : "29x29", |
||||
"idiom" : "ipad", |
||||
"scale" : "2x", |
||||
"size" : "29x29" |
||||
"filename" : "Icon-App-29x29@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "40x40", |
||||
"idiom" : "ipad", |
||||
"scale" : "1x", |
||||
"size" : "40x40" |
||||
"filename" : "Icon-App-40x40@1x.png", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"size" : "40x40", |
||||
"idiom" : "ipad", |
||||
"scale" : "2x", |
||||
"size" : "40x40" |
||||
"filename" : "Icon-App-40x40@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "76x76", |
||||
"idiom" : "ipad", |
||||
"scale" : "1x", |
||||
"size" : "76x76" |
||||
"filename" : "Icon-App-76x76@1x.png", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"size" : "76x76", |
||||
"idiom" : "ipad", |
||||
"scale" : "2x", |
||||
"size" : "76x76" |
||||
"filename" : "Icon-App-76x76@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "83.5x83.5", |
||||
"idiom" : "ipad", |
||||
"scale" : "2x", |
||||
"size" : "83.5x83.5" |
||||
"filename" : "Icon-App-83.5x83.5@2x.png", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"size" : "1024x1024", |
||||
"idiom" : "ios-marketing", |
||||
"scale" : "1x", |
||||
"size" : "1024x1024" |
||||
"filename" : "Icon-App-1024x1024@1x.png", |
||||
"scale" : "1x" |
||||
} |
||||
], |
||||
"info" : { |
||||
"author" : "xcode", |
||||
"version" : 1 |
||||
"version" : 1, |
||||
"author" : "xcode" |
||||
} |
||||
} |
||||
|
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 970 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
@ -0,0 +1,12 @@ |
||||
import Flutter |
||||
import UIKit |
||||
import XCTest |
||||
|
||||
class RunnerTests: XCTestCase { |
||||
|
||||
func testExample() { |
||||
// If you add code to the Runner application, consider adding tests here. |
||||
// See https://developer.apple.com/documentation/xctest for more information about using XCTest. |
||||
} |
||||
|
||||
} |
@ -1,26 +1,30 @@ |
||||
// This is a basic Flutter widget test. |
||||
// |
||||
// To perform an interaction with a widget in your test, use the WidgetTester |
||||
// utility that Flutter provides. For example, you can send tap and scroll |
||||
// utility in the flutter_test package. For example, you can send tap and scroll |
||||
// gestures. You can also use WidgetTester to find child widgets in the widget |
||||
// tree, read text, and verify that the values of widget properties are correct. |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_test/flutter_test.dart'; |
||||
|
||||
import '../lib/main.dart'; |
||||
import 'package:flutter_openim_sdk_example/main.dart'; |
||||
|
||||
void main() { |
||||
testWidgets('Verify Platform version', (WidgetTester tester) async { |
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
||||
// Build our app and trigger a frame. |
||||
await tester.pumpWidget(MyApp()); |
||||
|
||||
// Verify that platform version is retrieved. |
||||
expect( |
||||
find.byWidgetPredicate( |
||||
(Widget widget) => widget is Text && widget.data!.startsWith('Running on:'), |
||||
), |
||||
findsOneWidget, |
||||
); |
||||
// Verify that our counter starts at 0. |
||||
expect(find.text('0'), findsOneWidget); |
||||
expect(find.text('1'), findsNothing); |
||||
|
||||
// Tap the '+' icon and trigger a frame. |
||||
await tester.tap(find.byIcon(Icons.add)); |
||||
await tester.pump(); |
||||
|
||||
// Verify that our counter has incremented. |
||||
expect(find.text('0'), findsNothing); |
||||
expect(find.text('1'), findsOneWidget); |
||||
}); |
||||
} |
||||
|