Skip to content

Commit

Permalink
try to fix the MissingPluginException pb
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Wei committed Mar 6, 2021
1 parent 3ac0e02 commit bf75449
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ android {
// Cf. https://github.com/flutter/flutter/issues/53657#issuecomment-642236438
ndkVersion '21.3.6528147'

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}
Expand Down Expand Up @@ -74,9 +78,10 @@ android {
ndk {
debugSymbolLevel 'FULL'
}
// Cf. https://github.com/flutter/flutter/issues/65334#issuecomment-748523100
shrinkResources false
minifyEnabled false
shrinkResources true
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
Expand Down
1 change: 1 addition & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class androidx.lifecycle.DefaultLifecycleObserver
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ package io.github.x_wei.flutter_catalog
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine) // add this line
}
}

0 comments on commit bf75449

Please sign in to comment.