質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

1361閲覧

ビルドエラーで起動できない

j06110611

総合スコア54

Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2023/03/03 13:17

編集2023/03/04 12:38

発生している問題・エラーメッセージ

* What went wrong: Execution failed for task ':shared_preferences_android:compileDebugJavaWithJavac'. > Failed to calculate the value of task ':shared_preferences_android:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'. > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\User\StudioProjects\translation_diary\build\shared_preferences_android\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@107a4919) before task ':shared_preferences_android:compileDebugJavaWithJavac' has completed is not supported

試したこと・現状

これを読みました。でも下記のgradle-wrapper.propertiesの通りgradleのバージョン7.6なのでよくわからないままです
build.gradle追記したのでおかしなところでもあれば教えてほしいです。

build.gradle

gradle

1def localProperties = new Properties() 2def localPropertiesFile = rootProject.file('local.properties') 3if (localPropertiesFile.exists()) { 4 localPropertiesFile.withReader('UTF-8') { reader -> 5 localProperties.load(reader) 6 } 7} 8 9def flutterRoot = localProperties.getProperty('flutter.sdk') 10if (flutterRoot == null) { 11 throw new java.io.FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12} 13 14def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15if (flutterVersionCode == null) { 16 flutterVersionCode = '1' 17} 18 19def flutterVersionName = localProperties.getProperty('flutter.versionName') 20if (flutterVersionName == null) { 21 flutterVersionName = '1.0' 22} 23 24apply plugin: 'com.android.application' 25apply plugin: 'kotlin-android' 26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 28android { 29 compileSdkVersion 31 30 31 sourceSets { 32 main.java.srcDirs += 'src/main/kotlin' 33 } 34 35 defaultConfig { 36 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 applicationId "com.example.translation_diary" 38 minSdkVersion 16 39 targetSdkVersion 31 40 versionCode flutterVersionCode.toInteger() 41 versionName flutterVersionName 42 } 43 44 buildTypes { 45 release { 46 // TODO: Add your own signing config for the release build. 47 // Signing with the debug keys for now, so `flutter run --release` works. 48 signingConfig signingConfigs.debug 49 } 50 } 51} 52 53flutter { 54 source '../..' 55} 56 57dependencies { 58 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59}

gradlewrapper.properties

properties

1distributionBase=GRADLE_USER_HOME 2distributionPath=wrapper/dists 3zipStoreBase=GRADLE_USER_HOME 4zipStorePath=wrapper/dists 5distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 6

補足情報

shared_preferencesのバージョン 2.0.13
gradleのバージョン 7.6

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

y_waiwai

2023/03/03 23:11

コードを提示しよう
Daregada

2023/03/04 08:16

検索すべきは「options.generatedSourceOutputDirectory」のほうでは。同じエラーが発生して対応している日本語のブログが見つかります。
guest

回答1

0

自己解決

最後のエラーはAGPのバージョンが原因でお恥ずかしながら久しぶりで忘れてたのかandroidではなくappの下のbuild.gradleばっかり開いててわかんなくなってましたw

投稿2023/03/15 06:17

編集2023/03/15 06:19
j06110611

総合スコア54

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問