android studio 3.2 preview gradle sync failed but build success - android-studio-3.2

Build/Sync window showed the 'CONFIGURE SUCCESSFUL' and Build Successful.
But the android studio still show the error: "Gradle project sync failed. Basic functionality will not work properly"

Update at 2019/01/15
Update android studio to 3.3 fix this problem!
I face this too.
Not a solve, but you can try.
In your project gradle file
change gradle version from 3.2.0 to 3.1.4
com.android.tools.build:gradle:3.1.4
In gradle-wrapper.properties file
change gradle version from 4.6 to 4.4
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

My problem was there was no google() in my repo list under all projects:
allprojects {
repositories {
jcenter()
google()
}
}

Related

Intellij 14 Grails Project Error on run-app: Module not backed by Gradle

I recently downloaded a new Intellij version 2017 for Grails 3 upgrade .I am using Intellij 14 with Grails 2.3.7.When I was prompted to import settings for new version,I clicked yes .Now however when I try to run my existing 2.3.7 project in Intellij 14 ,it complains Module not backed by gradle. I did not use gradle in my 2.3.7 Project.How to run this app.
Apparently my project.iml file was messed up.I had to clean that up and was able run in previous version.Thanks All
you can use the ./gradlew command with gradle installed in your machine to rebuild your gradle project.

DexGuard integration in Android Studio 3.0

I have upgraded my Android project to use the latest Android Studio 3.0 features. Since then, I am getting the following warning message on each Gradle sync:
Warning:One of the plugins you are using supports Java 8 language
features. To try the support built into the Android plugin, remove the
following from your build.gradle:
apply plugin: 'dexguard' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html
If I go to the linked URL, I can see:
If Android Studio detects that your project is using Jack,
Retrolambda, or DexGuard, the IDE uses Java 8 support provided by
those tools instead.
There are migration docs for Jack and Retrolambda, but none for DexGuard.
My questions are:
Can I remove the DexGuard plugin and it will still work as expected?
If no, how should I go around resolving this warning?
I am running Android Studio 3.0 and DexGuard 8.0.16
You are probably using Dexguard for code obfuscation, encryption or tamper detection. So removing it will remove those functionalities. You should try out the 8.0.17 release of dexguard and remove retrolamb, Jack and the Dexguard-java8 plugin from your build config.
On my app this seems to keep working, on 8.0.15/8.0.16 I still had to enable dexguard-java8 to have it working.
in your app build.gradle add this to enable java8 compiling.
apply plugin: 'dexguard'
...
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
In your project.gradle just add
buildscript {
repositories {
flatDir { dirs 'dexguard' }
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath ':dexguard:'
...
}
}
and make sure there are no references to retrolambda or dexguard-java8 in your gradle files and everything should work fine.

Nuget Installer task fails in tfs 2017 builds

We are using Nuget Installer step that restores the missing nuget packages in TFS build, this step fails with the following error:
E:\Builds\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive E:\Builds\test.sln
MSBuild auto-detection: using msbuild version '3.5' from 'C:\Windows\Microsoft.NET\Framework\v3.5'.
Error parsing solution file at E:\Builds\test.sln: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
Error: E:\Builds\Agent2017Update1_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
Packages failed to install
The error message seems to be confusing as the file specified is present on build agent.
TFS build agent version:2.112.0
TFS version: TFS 2017 update 1
In the Advanced options change the version to 3.5 for NuGet. I've been having weird issues the last 2 weeks where 3.3 would do similar to what you are experiencing and switching to 3.5 works as expected.
Hope this works for you as well =D
This seems to be due to the fact that the msbuild.exe in your path (your build agent) is version 3.5. MSBuild 3.5 does not have two .dll's that nuget are attempting to load dynamically (Microsoft.Build.dll and Microsoft.Build.Framework.dll).
A solution to fix this issue, please make sure NuGet.exe uses MSBuild
4.0 or higher. This can be done by making sure MSBuild 4.0 or higher is the first to resolve in your path or by passing the -msbuildversion
option. For example, use MSBuild 14.0 (which shipped with Visual
Studio 2015).
nuget.exe pack MyProj.csproj -msbuildversion 14.0
More details please refer this similar issue nuget pack fails when MSBuild version resolved to MSBuild 3.5

Incompatible Bitbucket plugin 1.2.1 for Android Studio 2.0/2.1/3.0+

I have updated version of my Android Studio to 2.0 and is facing incompatibility issue of bitbucket plugin 1.2.1 when loading Android Studio.
Android Studio's Event log is saying:
"Plugin Error
Problems found loading plugins:
Following plugins are incompatible with current IDE build: Bitbucket"
Can anyone help me regarding?
Thanks in advance.
Try use jetbrains bitbucket connector, open this link and download the package:
https://drive.google.com/open?id=1L0bEhoCIrV9Jced1fqdYscI34wwuKyvQ
After dowloading you need install this plugin (Don't extract the package).
In Android Studio, follow the menu items path:
File => Settings => Plugins => Install plugin from disk => {choose downloaded package} => Restart Android Studio

build Grails 3 war with specific java compiler version

I am using IDEA 15. I have a grails 3 project setup. The app server I need to deploy to has Java Version 7. My local JDK is Java 8. I have set some properties in my build.gradle to use the target version 1.7.
apply plugin: 'java'
compileJava {
targetCompatibility = '1.7'
}
When I rebuild my project, it generates class files for 1.7, but when I run a maven war build from the IDEA menu, the classes are rebuilt and end up being Java 8 versions. I have set Java version in my project to 1.7 as well, but this did not help. How can I get to where I am producing a war file from my grails app that contains 1.7 versioned class files?
Thanks!
What are you using to build war file? "grails war" or "gradle war". Try to use gradle.

Resources