Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cannot Build Flutter APK #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linter:
rules:
- camel_case_types
- hash_and_equals
- iterable_contains_unrelated_type
- list_remove_unrelated_type
# - iterable_contains_unrelated_type
# - list_remove_unrelated_type
- unrelated_type_equality_checks
- valid_regexps
- valid_regexps
14 changes: 13 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,27 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
namespace = "com.example.installplugin"
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 // Set Java version to 1.8
targetCompatibility JavaVersion.VERSION_1_8 // Set target compatibility to 1.8
}

kotlinOptions {
jvmTarget = "1.8" // Set Kotlin jvm target to 1.8
}

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

defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

lintOptions {
disable 'InvalidPackage'
}
Expand Down
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.installplugin">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<application>
Expand Down
7 changes: 4 additions & 3 deletions test/install_plugin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ void main() {
final List<MethodCall> log = <MethodCall>[];
String? response;

channel.setMockMethodCallHandler((MethodCall methodCall) async {
log.add(methodCall);
return response;
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
log.add(methodCall); // Log the method call
return response; // Return the predefined response
});

tearDown(() {
Expand Down