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
Flutter App is crashing in runtime after adding plugins #25862
Comments
@KarimMohamed2005 |
flutter doctor -v log :
|
@KarimMohamed2005 You mean it will crash, can you paste the crash info with "adb logcat"? Besides, please read #14020 to see if it helps. |
|
can anyone help ? |
@zoechi android/build.gradlebuildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
} android/app/build.gradledef localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
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')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.gocloud"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
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
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:support-v4:28.0.0'
} |
I have this very problem with the image_picker package, but for versions 26- to 27.1.1. When I require it, the project won't build. When I remove it, it works normally. Removing the image_picker from your project didn't work for me, so maybe other packages have this issue. The solution you provided for the build.gradle worked for me though, as stated here: #14020 (comment) |
I think you saved my life 💯 . |
@KarimMohamed2005 Even though you've worked around the issue, it's still a bug, so please reopen. GitHub issues are for reporting bugs and if you can't find information on how to do something on the Flutter site (documentation problems), not for solving your specific problems. |
Hi @KarimMohamed2005 |
Actually I didn't try from along time but I think it will work fine without problems |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I have a project and it 's now in deployment there 's some plugins I needed to add in pubspec.yaml
after running
flutter build apk
but after adding this code
to android/build.gradle there 's no error appeared but now I had many problems in runtime and app crashes anyone can help ?
The text was updated successfully, but these errors were encountered: