More than one file was found with OS independent path ‘META-INF/LICENSE’

You can add this in yourProject/app/build.gradle inside android{}. The exclude function adds the named resource to the list of resources that are not packaged in the APK. android { packagingOptions { exclude ‘META-INF/DEPENDENCIES’ exclude ‘META-INF/LICENSE’ exclude ‘META-INF/LICENSE.txt’ exclude ‘META-INF/license.txt’ exclude ‘META-INF/NOTICE’ exclude ‘META-INF/NOTICE.txt’ exclude ‘META-INF/notice.txt’ exclude ‘META-INF/ASL2.0’ exclude(“META-INF/*.kotlin_module”) } } The exclude function is deprecated … Read more

No matching client found for package name (Google Analytics) – multiple productFlavors & buildTypes

Check your package name on your google-services.json it should be same with your local package name of your app Example “client_info”: { “mobilesdk_app_id”: “1:6596814400689:android:65d6f25f5006145”, “android_client_info”: { “package_name”: “com.my.app.package.name” } In this case my local package name is com.my.app.package.name so also i have changed my package name in google-services.json with my local package name

How to run only one unit test class using Gradle

To run a single test class Airborn’s answer is good. With using some command line options, which found here, you can simply do something like this. gradle test –tests org.gradle.SomeTest.someSpecificFeature gradle test –tests *SomeTest.someSpecificFeature gradle test –tests *SomeSpecificTest gradle test –tests all.in.specific.package* gradle test –tests *IntegTest gradle test –tests *IntegTest*ui* gradle test –tests *IntegTest.singleMethod gradle … Read more

How to create a release signed apk file using Gradle?

Easier way than previous answers: Put this into ~/.gradle/gradle.properties RELEASE_STORE_FILE={path to your keystore} RELEASE_STORE_PASSWORD=***** RELEASE_KEY_ALIAS=***** RELEASE_KEY_PASSWORD=***** Modify your app/build.gradle, and add this inside the android { code block: … signingConfigs { release { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD // Optional, specify signing versions used v1SigningEnabled true v2SigningEnabled true } } buildTypes { … Read more

Automatically accept all SDK licences

UPDATE 2021 This should be the accepted answer as its easy and upto date AndroidSDK can finally accept licenses. Go to Android\sdk\tools\bin yes | sdkmanager –licenses EDIT: as pointed out in the comments by @MoOx, on macOS, you can do yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager –licenses as pointed out in the comments by @pho, @mikebridge and … Read more

You have not accepted the license agreements of the following SDK components [duplicate]

The way to accept license agreements from the command line has changed. You can use the SDK manager which is located at: $ANDROID_SDK_ROOT/tools/bin e.g on linux: cd ~/Library/Android/sdk/tools/bin/ Run the sdkmanager as follows: ./sdkmanager –licenses e.g on Windows: cd /d “%ANDROID_SDK_ROOT%/tools/bin” Run the sdkmanager as follows: sdkmanager –licenses And accept the licenses you did not … Read more

Android Studio Error “Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8”

Make sure that your Gradle is using the proper JDK. Try running ./gradlew –version in your project’s directory. The output should be something like this: Gradle 7.0-rc-2 ———————————————————— Build time: 2021-04-01 21:26:39 UTC Revision: 912a3368b654b71250dfc925a20d620393 Kotlin: 1.4.31 Groovy: 3.0.7 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.10 (Ubuntu 11.0.10+9-Ubuntu-0ubuntu1.20.10) OS: Linux … Read more

Using Gradle to find dependency tree

Without modules: gradle dependencies For Android: gradle app:dependencies Using gradle wrapper: ./gradlew app:dependencies Note: Replace app with the project module name. Additionally, if you want to check if something is compile vs. testCompile vs androidTestCompile dependency as well as what is pulling it in: ./gradlew :app:dependencyInsight –configuration compile –dependency <name> ./gradlew :app:dependencyInsight –configuration testCompile –dependency … Read more

tech