Error:(1, 0) Plugin with id ‘com.android.application’ not found

Updated Answer (Dec. 2, 2020) Latest Gradle: 6.5 Version check: ./gradlew -v How to update: Set URL: ./gradlew wrapper –gradle-version=6.5 –distribution-type=all Update: ./gradlew wrapper Latest Android Gradle Plugin: 4.1.0 If you add the following code snippet to the top of your build.gradle file. Gradle will update the build tools. buildscript { repositories { google() // … Read more

HttpClient won’t import in Android Studio

HttpClient is not supported any more in sdk 23. You have to use URLConnection or downgrade to sdk 22 (compile ‘com.android.support:appcompat-v7:22.2.0’) If you need sdk 23, add this to your gradle: android { useLibrary ‘org.apache.http.legacy’ } You also may try to download and include HttpClient jar directly into your project or use OkHttp instead

Is it possible to declare a variable in Gradle usable in Java?

Here are two ways to pass value from Gradle to use in Java; Generate Java Constants android { buildTypes { debug { buildConfigField “int”, “FOO”, “42” buildConfigField “String”, “FOO_STRING”, “\”foo\”” buildConfigField “boolean”, “LOG”, “true” } release { buildConfigField “int”, “FOO”, “52” buildConfigField “String”, “FOO_STRING”, “\”bar\”” buildConfigField “boolean”, “LOG”, “false” } } } You can access … Read more

How to manually include external aar package using Gradle for Android

Please follow below steps to get it working ( I have tested it up to Android Studio 2.2) Lets say you have kept aar file in libs folder. ( assume file name is cards.aar ) then in app build.gradle specify following and click sync project with Gradle files. Open Project level build.gradle and add flatDir{dirs … 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

Is it possible to use Java 8 for Android development?

UPDATE 2017/11/04 – Android Studio 3.0 now has native support for Java 8. gradle-retrolambda is now no longer needed. See https://developer.android.com/studio/write/java8-support.html The above link also includes migration instructions if you are using gradle-retrolambda. Original answer below: Android does not support Java 8. It only supports up to Java 7 (if you have kitkat) and still … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)