初心者質問で申し訳ないのですが、どのタイミングか不明なのですが、Flutterプロジェクトがビルドできなくなりました。
実行ボタンを押してもエミュレーターにapkがインストールされません。
おそらく、タイミング的にはFirebase関連の実装をしている際に起きていると思われます。
根拠としては、ターミナルからFlutter runすると以下が出力され、その中を読むとfirebase_authに関連するエラーと思われるからです。
pubspec.yaml~build.gradleはstackoverflowあたりの類似のトラブルシューティングを見ていろいろと弄った結果です。
gradleに関する知識に乏しく、あまり的確な質問ができていないと思いますが、何かしら思い当たる箇所がございましたらご指摘いただければ幸いです。よろしくお願いいたします。(副次的ですが、ターミナルが文字化けしている原因もご教示いただければ幸いです。)
C:\Users\okape\Documents\flutter_app>flutter run Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib\main.dart on Android SDK built for x86 in debug mode... registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.2+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:8: �G���[: �p�b�P�[�Wandroid. support.annotation�͑��݂��܂��� import android.support.annotation.NonNull; ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.2+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:538: �G���[: �V���{���� public void onComplete(@NonNull Task<AuthResult> task) { ^ �V���{��: �N���X NonNull �ꏊ: �N���X FirebaseAuthPlugin.SignInCompleteListener C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.2+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:558: �G���[: �V���{���� public void onComplete(@NonNull Task<Void> task) { ^ �V���{��: �N���X NonNull �ꏊ: �N���X FirebaseAuthPlugin.TaskVoidCompleteListener C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.6.2+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:576: �G���[: �V���{���� <途中略> FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.
pubspec.yaml
name: flutter_app description: A new Flutter application. version: 1.0.0+1 environment: sdk: ">=2.1.0 <3.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 firebase_auth: ^0.6.2+1 cloud_firestore: ^0.13.0+1 firebase_core: ^0.4.0 dev_dependencies: flutter_test: sdk: flutter flutter: uses-material-design: true assets: - assets/
androidフォルダ直下のbuild.gradle
buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:3.2.1' // Google Services plugin } } allprojects { repositories { google() jcenter() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } task clean(type: Delete) { delete rootProject.buildDir }
app直下のbuild.gradle
def 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 FileNotFoundException("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 plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/buiYld/application-id.html). applicationId "com.example.flutter_app" minSdkVersion 16 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.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 { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' } apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
app直下のbuild.gradle
def 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 FileNotFoundException("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 plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/buiYld/application-id.html). applicationId "com.example.flutter_app" minSdkVersion 16 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.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 { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' } apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/02/23 06:00
退会済みユーザー
2020/02/23 06:23
2020/02/23 07:10
退会済みユーザー
2020/02/23 11:09