~~editing~~ `Day 50` - Fixed several issues with G...
# 100daysofkotlin-2021
b
editing
Day 50
• Fixed several issues with Gradle (see thread) • Started a Shopping List App that focuses on TDD

(same course)

Self-Comment
• The gradle issues are becoming easier to fix thanks to them following the same pattern. Although I've yet to experience this many issues until I started to dive into Testing. I wonder if it's because I'm using AS Arctic Fox Canary 15 instead of an AS stable version. I was having similar issues when I attempted AS 4.2... • Half way to the 100 day mark! I'm going to have to pick up the pace after the last 10 days of progress 👀🎉Kandroid dance
Goals Tomorrow
• Continue Testing • Possibly do this problem (random easy on Leetcode)
2
Issues with finding double META files in a new project. I'm not sure why.. As I've solved this recently, I went ahead and added the following code to my build.gradle.kts (:app) file
Copy code
packagingOptions {
        exclude("META-INF/*.")
    }
exclude is now deprecated. Changed the code above to:
Copy code
packagingOptions {
        resources.excludes.add("META-INF/*.")
    }
Copy code
Warning: Mapping new ns <http://schemas.android.com/repository/android/common/02> to old ns <http://schemas.android.com/repository/android/common/01>
Warning: Mapping new ns <http://schemas.android.com/repository/android/generic/02> to old ns <http://schemas.android.com/repository/android/generic/01>
Warning: Mapping new ns <http://schemas.android.com/sdk/android/repo/addon2/02> to old ns <http://schemas.android.com/sdk/android/repo/addon2/01>
Warning: Mapping new ns <http://schemas.android.com/sdk/android/repo/repository2/02> to old ns <http://schemas.android.com/sdk/android/repo/repository2/01>
Warning: Mapping new ns <http://schemas.android.com/sdk/android/repo/sys-img2/02> to old ns <http://schemas.android.com/sdk/android/repo/sys-img2/01>
Copy code
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Failed to query the value of task ':app: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:\code\Codelabs\ShoppingListTesting\app\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@1d0761dd) before task ':app:compileDebugJavaWithJavac' has completed is not supported
.... Fixed replacing
Copy code
classpath "com.android.tools.build:gradle:4.0.2"
with
Copy code
classpath 'com.android.tools.build:gradle:7.0.0-alpha15'
I realized I'm using Arctic Fox Canary 15, while the tutorial is probably made with the stable version of Android Studio 😅
Another error that involves excluding packaging options:
Copy code
* What went wrong:
Execution failed for task ':app:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'win32-x86/attach_hotspot_windows.dll' from inputs:
      - C:\Users\bryan\.gradle\caches\transforms-3\8505bba1d18479bad5612129dfae9c3b\transformed\jetified-kotlinx-coroutines-debug-1.4.3.jar
      - C:\Users\bryan\.gradle\caches\transforms-3\eb4647ddf36e5a464415724c18c3b59c\transformed\jetified-byte-buddy-agent-1.10.20.jar
     Adding a packagingOptions block may help, please refer to
     <https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html>
     for more information
added
Copy code
packagingOptions {
        exclude "**/attach_hotspot_windows.dll"
        exclude "META-INF/licenses/**"
        exclude "META-INF/AL2.0"
        exclude "META-INF/LGPL2.1"
    }
Did the trick to solve this
j
Wow halfway already! (A day left for me though 😋) Congrats🎊