Gradle compatibility between Android Studio 4.0.1 and IntelliJ 2020.2 IDE - gradle

Just an observation that AS4.0.1 no longer clobbers IntelliJ (2020.2) initiated project settings any more, and merely complains of 'unsupported Modules' being detected(Note *).
Is this the beginning of Détente with peaceful co-existence (I wouldn't want to be unhappily surprised in future)?
Just to give specific context, here is what I refer to: (both reject the last configuration - a failed hack) and utilise their preferred first or second one respectively: This is a GOOD thing)
From IDEA 2020.2:
Unsupported Modules Detected: Compilation is not supported for following modules: CalibSense.app.
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
The IDE modules below were removed by the Gradle project reload:
app
You can open DIALOG to select the ones you need to restore.
DIALOG LIST:
Android App:
[x]app
[v]Badroid.CalibSense.app (level: WORKSPACE)
[x]CalibSense.app (level: WORKSPACE)
From AndroidStudio 4.0.1(somewhere between IDEA 2019.2 and 2019.3):
Unsupported Modules Detected: Compilation is not supported for following modules: CalibSense.app.
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
DIALOG LIST:
Android App:
[v]app
[x]Badroid.CalibSense.app (level: WORKSPACE)
[x]CalibSense.app (level: WORKSPACE)
Suggested Update AS 4.1 (including - All improvements from IntelliJ IDEA 2020.1.4)
Note *: It turns out they both complain of an illegal configuration, not of each others working configuration.

Nope.
The problem is in a different version of the IntelliJ Platform. Android Studio and IntelliJ Idea is developing separately because it's different products of different companies.
Google adopts the IntelliJ Platform in Android Studio - so we can think about it as about hacked IDEA.
So usually backward compatibility exists - it means that I can open in a new version of IntelliJ IDEA my older projects, but not vice versa.
So if look at AS 4.0 release notes we can mention that it is based on IntelliJ IDEA 2019.3.3 (https://developer.android.com/studio/releases#4.0-idea-2019-3-3). But your try to open a project of newer version IntelliJ Platform (2020.2). So it fails because your try to open a newer project version (2020.2) by old IDEA (2019.3.3)
But you can without issues open a project of AS 4.0 with IDEA 2020.2 - it will simply convert older project layout to new.

Related

Why is Android Studio failing to build, with an AAPT2 error on images?

After a recent update, Android Studio fails to build an unmodified project with errors along these lines:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.1.1-6503028-linux Daemon #0: Unexpected error during compile '/path/to/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
Notice that it's failing on an image supplied by Android Studio itself!
What can I do to fix it?
This seems to be an error in the newest (newer?) Gradle plugin(s) when it comes to PNG images; Google's IssueTracker lists several newly reported bugs along these lines. One of them mentions that it's a Gradle issue; I made mine work by reverting to a previous version: Gradle Plugin 4.0.1 and Gradle version 6.1.1 work fine.
It will be necessary to ignore AS' nagging about a newer version until this gets fixed.
[Added at the request of #YinOrYan]
To revert to an older version of Gradle:
In the menu, select "Files", then "Project Structure..."
In the dialog that pops up, select "Project" (first item in my version).
You can select the desired versions of the Gradle plugin and of Gradle from the drop-down menus.
This should not lose any system calls, as this is different from the SDK or API versions. However, it's not independent of them, so there is probably a limit to where you can set them.
As usual you will want to be online when you first build, or whenever you have to import a dependency, but otherwise it should be possible to work offline.
Sadly, it looks like an issue with older architectures. While the team at Google is looking into fixing it, in the meanwhile you can still use the new Android Studio and AGP, but temporarily revert to using an older version of AAPT2:
Try locating the old aapt2 executable in your gradle cache, e.g.:
~/.gradle/caches/<subdirectories, hashes
etc>/aapt2-4.1.0-alpha03-6246747-/aapt2(.exe)
Once you have the path you can add to your gradle.properties file:
android.aapt2FromMavenOverride=path/to/old/aapt2
To make this a little bit more robust you can actually copy that executable to a non-cache location, in case you clean your caches and it dissapears.
Hope this helps! Keep an eye on the Issue Tracker bug for updates.
I also had the same problem with AAPT2 errors and I have got over it.
First, downgrades Gradle to version 4.0.1, or
Second, I have done is upgrading the AMD Athlon processor to AMD FX-4300 without downgrading the gradle plugin version.
Wow, that's a real show-stopper! Can you explain how you reverted to an older gradle in Android Studio. Is it possible to work offline after doing this. And, did you lose any of the new system calls as a result? All this going on after finally getting my code working with the new AR Core stuff...

Netbeans 11 Gradle Project does not run gradle on save

I have just installed Netbeans 11.1 and when I save one of my Java files, Netbeans does not start a gradle build automatically. This used to work in Netbeans 8.2.
I have installed nb-javac and have also tried the newest Beta version to no avail.
Is this a known bug or do I need to reconfigure something when going from NB 8.2 to 11.1?
(This is only an explanation rather than a solution to your problem.)
First, Compile on Save is an option which is set or unset at the individual project level, rather than at the global level. So for a NetBeans Gradle project, select Properties > Build > Compile to view the setting for the Compile on Save checkbox. For that checkbox, note that:
It is unchecked by default, so there will not be an automatic Gradle build when you save a project file.
It is disabled, so you cannot trigger a build whenever you save a project file.
The problem persists in the latest beta of NetBeans 11.2.
I don't see a bug report for this issue, so perhaps you can raise one? Click the Log In button to sign up first if necessary.
That said, there is a related issue which may explain why the check box cannot be enabled. See closed bug NETBEANS-680 Erroneous Gradle Compile-on-Save activity which relates to Gradle projects using version 9.0 of NetBeans. Apparently there were spurious and unwanted compile-on-save runs being triggered even though Compile on Save was unchecked. Perhaps the feature has been deliberately disabled for Gradle projects because of that issue, though that is just speculation on my part.
Also see the GitHub page for the Gradle plugin. Comments from the NetBeans team for NETBEANS-680 suggest that the problem was with the plugin rather than NetBeans. That said, if NetBeans is offering functionality that cannot be enabled (i.e Compile on Save), it is definitely a NetBeans issue regardless of the underlying cause.
Finally, note that you can configure the Gradle plugin using Tools > Options > Java > Gradle, but I dodn't see any options there that would help with this issue.

OSGI plugin development with Domino Designer 10

Up to date I was using IBM Domino Designer V9.0.1 FP8 to develop an OSGI plugin. With this version everything was working as intended. I've created a plugin project, a feature project and an update site project. Selecting "Build all" in the update site project created all the the corresponding jar files.
Today I've installed IBM (HCL) Domino Desinger V10 FP2 (fresh install i.e. I've deinstalled V9.0.1 and deleted the old "workspace" directory in NotesData, but I kept the NotesData itself).
Now if I open my plugin projects, I can edit the plugin, save the Java classes without any errors. Up to this point everything is working as usual. But now, if I use "Build all" in the update site project I see a screen with "generating ant script" and then the build process is finished, but no jar files are generated.
Any ideas why this is happening? Am I missing some files? Am I missing some configurations?
BTW: if I use standard eclipse to build the plugin all jar files are generated.
Domino Designer is a customised version of Eclipse. 9.0.1 FP9 and lower is a very old version of Eclipse, 9.0.1 FP10+ is a much newer version, so not comparable to what was happening before. It's possible there are differences in the customisation of Eclipse that are affecting it. But every Domino OSGi plugin developer I'm aware of uses standard Eclipse.
Follow the steps for setting up your environment here https://github.com/OpenNTF/XPagesExtensionLibrary/wiki/Development-Environment. In the documentation there I've tried to document why steps are done and what they achieve, as well as just the steps themselves. The intention is to pass on understanding to a broader set of developers, for future proofing.

Error when enabling MultiDex or ProGuard in Xamarin Studio

I recently broke the Dalvik Limit (https://developer.android.com/studio/build/multidex.html)
of 64K referencs as I started getting
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/
Xamarin.Android.Common.targets: Error: Tool exited with code: 2.
Output: trouble writing output: Too many field references: 77369; max
is 65536. You may try using --multi-dex option.
error after updating some nugets to MonoDroid 7.
When I turn on the MultiDex option in android settings and compile my project I get -
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
Error: Tool exited with code: 10. Output: Error: Can't read
[/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.1-3/lib/xbuild-frameworks/MonoAndroid/v7.0/mono.android.jar]
(Can't process class [android/app/ActivityTracker.class] (Unsupported
class version number [52.0] (maximum 51.0, Java 1.7)))
(pjr.mob.android)
I can see BUGs relating to this -
https://bugzilla.xamarin.com/show_bug.cgi?id=44187
https://bugzilla.xamarin.com/show_bug.cgi?id=44013
https://bugzilla.xamarin.com/show_bug.cgi?id=33052
https://bugzilla.xamarin.com/show_bug.cgi?id=35491
It looks like I have to manually download and install ProGuard 5.X as detailed in these answers -
Xamarin.Android Proguard - Unsupported class version number 52.0
Xamarin Android ProGuard Enable
and overcome any issues that arise from this.
Yet, Xamarin Studio explicitly tells us in the (i) information box next to the proguard option is that it is not recommended to run proguard for a DEBUG build and that we should only run multidex after trying proguard first.
Will this mean we cannot debug effectively after enabling it? but I cannot DEBUG anyway (I cannot even run a release build even with the linker on which I thought might help) now without enabling it?
Is there some kind of Xamarin Support coming for this or do I need to look at somehow reducing the packages etc that we use (I am not sure I can do as most of it is Google Play Services related).
Any help is appreciated.
Other Info from Xamarin Studio Help > About
Java SDK: /usr
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
Unsupported class version number [52.0] (maximum 51.0, Java 1.7)
1st) The error you got is from not having Java v8 installed and/or Xamarin configured to use it.
Ref: java Lang UnsupportedClassVersion Error in Xamarin Studio
2nd) MultiDex can be used without Proguard and is only needed on API-20 and below. Enabling Multi-Dex enables the Android SDK tools to create as many secondary sex file as needed.
3rd) If you are enabling Proguard, you should look at replacing the proguard.jar in your android-idk with the Facebook version as it is sooooo much faster ;-)
Ref: https://github.com/facebook/proguard
Or use the SourceForge-based one:
Ref: Xamarin.Android Proguard - Unsupported class version number 52.0
To clarify where I got to with this for future readers -
a) The 52.0 Error was due to the fact that the included ProGuard version with Xamarin required updating to the latest version (even after I had upgraded my JDK to 1.8 as discussed) -
Xamarin.Android Proguard - Unsupported class version number 52.0
NOTE: AFAIIA: I could not run multi-dex without fixing the proguard error first.
b) Xamarin Studio unfortunately lets you TICK pro guard for debug builds but then in turn does NOT actually run ProGuard for debug builds, causing confusion if you are very new to using it + trying to work out how things hang together.
The xamarin docs tell you this on inspection, which might be the case for VS -
ProGuard is disabled by default. The Enable ProGuard option is
available only when the project is set to Release mode. All ProGuard
build actions are ignored unless Enable ProGuard is checked.
c) So, when hitting the MultiDex limit; in order to progress -
DEBUG - enable multiplex only, this should (when working, I am still working on it in XS) allow you to bypass the 64K error as expected AND debug will work as expected.
You should leave your linker to No Linking as usual for debug builds.
RELEASE - enable ProGuard firstly to see if you can configure it to bring down your method count without requiring the overhead or multidex as it brings in the secondary methods at run-time.
If you don't want to mess with Proguard config then as an intermediate step your multidex set-up from DEBUG should just work for your release when fully tested.
When any documentation states you should try ProGuard first and then multidex it means just for a RELEASE not for debug build.
UPDATE: I also had to go via Xamarin Support to get my Multi-dex to build, but as of https://releases.xamarin.com/stable-release-cycle-8-service-release-1/ this is now working fine. My Android project in XS had a custom application class and that was not being correctly inherited by the build tools from the required multidex class when ticking Multidex.
Under Xamarin Studio -> Preferences -> Projects -> SDK Locations -> Andorid was pointing to a directory that I was no longer using for the more recent SDK updates. Changed it to point to the correct SDK directory and build succeeded.

LibGDX Build Model error

I am trying to create a LibGDX project using Gradle. I have already "created" the project using the Gradle setup app, but when I try to import it on Eclipse, I receive the following error:
org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
I prompted me to see the error log, but (I know this is embarrassing) I can't locate the error log.
So I am stuck at the very last hurdle. One thing I may have done to cause the error was not downloading the Android component (I am not interested in creating apps, only desktop applications). I have unchecked the Android app box in the Gradle setup though. The "root folder" I created my project using the setup is in
C:[Name]\Programming\Game
Inside game were all my files like gradle, .gradle, core, desktop. The import box seemed to find it ok. It's just that build error that stops me (The progress bar barely went past %5 before giving me the error)
To develop your application via Eclipse, you need to install the following pieces of software. You can find an in depth guide HERE:
Java Development Kit 7+ (JDK) (6 will not work!): http://www.oracle.com/technetwork/java/javase/downloads/index.html
Android SDK: http://developer.android.com/sdk/installing.html
Android Development Tools for Eclipse:
https://dl-ssl.google.com/android/eclipse/ (use this link as update site for eclipse)
Eclipse Integration Gradle:
http://dist.springsource.com/snapshot/TOOLS/gradle/nightly (for
Eclipse 4.4) or http://dist.springsource.com/release/TOOLS/gradle (for
Eclipse < 4.4)
Then you will need to download the project generator from here:
http://libgdx.badlogicgames.com/download.html
Last but not least, you will need to import the project as Gradle project in Eclipse.
See also:
https://github.com/libgdx/libgdx/wiki/Setting-up-your-Development-Environment-(Eclipse,-Intellij-IDEA,-NetBeans)
https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle

Resources