発生している問題・エラーメッセージ
* 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
回答1件
あなたの回答
tips
プレビュー