Skip to content

Commit c5e1bd7

Browse files
authored
[mixin_logger] fix not working on android (#303)
* [mixin_logger] fix not working on android * bump version
1 parent 6927ef8 commit c5e1bd7

File tree

27 files changed

+397
-11
lines changed

27 files changed

+397
-11
lines changed

packages/mixin_logger/.metadata

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "48f08e3db23f14e41051d672ed3da1bc65caa87d"
7+
revision: "0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2"
88
channel: "master"
99

1010
project_type: plugin_ffi
@@ -13,14 +13,23 @@ project_type: plugin_ffi
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
17-
base_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
16+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
17+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
18+
- platform: android
19+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
20+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
1821
- platform: ios
19-
create_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
20-
base_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
22+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
23+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
24+
- platform: linux
25+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
26+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
2127
- platform: macos
22-
create_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
23-
base_revision: 48f08e3db23f14e41051d672ed3da1bc65caa87d
28+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
29+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
30+
- platform: windows
31+
create_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
32+
base_revision: 0858ea2ce8f8c6a4d8732d7f1fc50af2f98877a2
2433

2534
# User provided section
2635

packages/mixin_logger/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.1
2+
3+
* add android support.
4+
15
## 0.1.0
26

37
* refactor implementation to c++, works on Windows/Linux/macOS/iOS.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// The Android Gradle Plugin builds the native code with the Android NDK.
2+
3+
group 'one.mixin.mixin_logger'
4+
version '1.0'
5+
6+
buildscript {
7+
repositories {
8+
google()
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
// The Android Gradle Plugin knows how to build native code with the NDK.
14+
classpath 'com.android.tools.build:gradle:7.3.0'
15+
}
16+
}
17+
18+
rootProject.allprojects {
19+
repositories {
20+
google()
21+
mavenCentral()
22+
}
23+
}
24+
25+
apply plugin: 'com.android.library'
26+
27+
android {
28+
if (project.android.hasProperty("namespace")) {
29+
namespace 'com.example.mixin_logger'
30+
}
31+
32+
// Bumping the plugin compileSdk version requires all clients of this plugin
33+
// to bump the version in their app.
34+
compileSdk 34
35+
36+
// Use the NDK version
37+
// declared in /android/app/build.gradle file of the Flutter project.
38+
// Replace it with a version number if this plugin requires a specfic NDK version.
39+
// (e.g. ndkVersion "23.1.7779620")
40+
ndkVersion android.ndkVersion
41+
42+
// Invoke the shared CMake build with the Android Gradle Plugin.
43+
externalNativeBuild {
44+
cmake {
45+
path "../src/CMakeLists.txt"
46+
47+
// The default CMake version for the Android Gradle Plugin is 3.10.2.
48+
// https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
49+
//
50+
// The Flutter tooling requires that developers have CMake 3.10 or later
51+
// installed. You should not increase this version, as doing so will cause
52+
// the plugin to fail to compile for some customers of the plugin.
53+
// version "3.10.2"
54+
}
55+
}
56+
57+
compileOptions {
58+
sourceCompatibility JavaVersion.VERSION_1_8
59+
targetCompatibility JavaVersion.VERSION_1_8
60+
}
61+
62+
defaultConfig {
63+
minSdkVersion 19
64+
}
65+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'mixin_logger'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="one.mixin.mixin_logger">
3+
</manifest>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
23+
}
24+
25+
android {
26+
namespace "com.example.mixin_logger_example"
27+
compileSdk flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
41+
}
42+
43+
defaultConfig {
44+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45+
applicationId "com.example.mixin_logger_example"
46+
// You can update the following values to match your application needs.
47+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48+
minSdkVersion flutter.minSdkVersion
49+
targetSdkVersion flutter.targetSdkVersion
50+
versionCode flutterVersionCode.toInteger()
51+
versionName flutterVersionName
52+
}
53+
54+
buildTypes {
55+
release {
56+
// TODO: Add your own signing config for the release build.
57+
// Signing with the debug keys for now, so `flutter run --release` works.
58+
signingConfig signingConfigs.debug
59+
}
60+
}
61+
}
62+
63+
flutter {
64+
source '../..'
65+
}
66+
67+
dependencies {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="mixin_logger_example"
4+
android:name="${applicationName}"
5+
android:icon="@mipmap/ic_launcher">
6+
<activity
7+
android:name=".MainActivity"
8+
android:exported="true"
9+
android:launchMode="singleTop"
10+
android:theme="@style/LaunchTheme"
11+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
12+
android:hardwareAccelerated="true"
13+
android:windowSoftInputMode="adjustResize">
14+
<!-- Specifies an Android theme to apply to this Activity as soon as
15+
the Android process has started. This theme is visible to the user
16+
while the Flutter UI initializes. After that, this theme continues
17+
to determine the Window background behind the Flutter UI. -->
18+
<meta-data
19+
android:name="io.flutter.embedding.android.NormalTheme"
20+
android:resource="@style/NormalTheme"
21+
/>
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN"/>
24+
<category android:name="android.intent.category.LAUNCHER"/>
25+
</intent-filter>
26+
</activity>
27+
<!-- Don't delete the meta-data below.
28+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
29+
<meta-data
30+
android:name="flutterEmbedding"
31+
android:value="2" />
32+
</application>
33+
<!-- Required to query activities that can process text, see:
34+
https://developer.android.com/training/package-visibility?hl=en and
35+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
36+
37+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
38+
<queries>
39+
<intent>
40+
<action android:name="android.intent.action.PROCESS_TEXT"/>
41+
<data android:mimeType="text/plain"/>
42+
</intent>
43+
</queries>
44+
</manifest>

0 commit comments

Comments
 (0)