IntelliJ IDEA+AndroidStudio local Android build failed

38 views
Skip to first unread message

P5music

unread,
Jun 3, 2021, 12:48:52 PM6/3/21
to CodenameOne Discussions
I have to run a slightly modified version of my CN1 app on the Android emulator.
I performed a local Android build on a Linux machine, as I did for the iOS build on a OSX machine.
The build failed with errors that can be found in the text attachments.

log1 is from AndroidStudio subsequent build.
log2 and log3 are from IntelliJ IDEA.

Thanks in advance
log1.txt
log3.txt
log2.txt

Shai Almog

unread,
Jun 3, 2021, 11:15:39 PM6/3/21
to CodenameOne Discussions
Do you have more than one version of Android Studio installed?
Which versions are installed on your system?

P5music

unread,
Jun 4, 2021, 2:28:06 AM6/4/21
to CodenameOne Discussions
I am using a Arch Linux system so the AndroidStudio installation is curated by the system itself. So I do not know what do you mean about two versions of it, but I provide some further information.
Android Studio 4.2.1
Build #AI-202.7660.26.42.7351085, built on May 10, 2021
Runtime version: 11.0.8+0-b944-P17168821 amd64
VM: OpenJDK 64-Bit Server VM by N/A
Linux 5.12.5-zen1-1-zen
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: external.system.auto.import.disabled=true
Current Desktop: GNOME 40.1.0
X11
Garuda Linux; ID version: rolling

What do you read inside the log files to say that? What's the issue about the build?

Regards

Shai Almog

unread,
Jun 5, 2021, 2:11:35 AM6/5/21
to CodenameOne Discussions
I can't read anything there. Usually Android studio offers an option to "fix" projects when there's a failure like that. As far as I know we don't use R8 so I'm guessing it was ignored by newer versions of Android Studio.

P5music

unread,
Jun 17, 2021, 3:10:13 AM6/17/21
to CodenameOne Discussions
I put

compileSdkVersion 30
buildToolsVersion "30.0.3"

in the gradle file, because I found that those fields were set to 0, like also

minSdkVersion 15
targetSdkVersion 30

they were 0 too.

In the txt attachment you can see the issue.
In the SDK manager I downloaded all the necessary.
On the internet someone says

From Android Studio go to: Tools >> Android >> SDK Manager

Select and install "Extras|Android Support Repository"

but I do not find it.

How to fix and compile?

Thanks in advance
gradle_issues.txt

Shai Almog

unread,
Jun 17, 2021, 11:30:54 PM6/17/21
to CodenameOne Discussions
What does the gradle file contain?

FYI we have here binaries which you can use to workaround problems with gradle: https://github.com/codenameone/cn1-binaries/tree/master/android

P5music

unread,
Jun 18, 2021, 2:17:25 AM6/18/21
to CodenameOne Discussions
Please see the attached file.
Regards

gradle_file.txt

Shai Almog

unread,
Jun 18, 2021, 11:27:51 PM6/18/21
to CodenameOne Discussions
I think this relates to the previous problems you fixed manually. The defaults should have been correct and you didn't need to explicitly state the versions.
What android.* build hints do you have in place?

P5music

unread,
Jun 21, 2021, 6:10:38 AM6/21/21
to CodenameOne Discussions
I just have a single android build hint

android.xintent_filter

By the way is it wrong?

1)Is the correct naming 
android.xintentFilter instead?

This is the content:
<intent-filter><action android:name="android.intent.action.SEND" /><action android:name="android.intent.action.VIEW" /><action android:name="android.intent.action.PICK" /><category android:name="android.intent.category.DEFAULT" /><category android:name="android.intent.category.BROWSABLE" /><category android:name="android.intent.category.OPENABLE" /><data android:scheme="file" /><data android:scheme="content" /><data android:mimeType="*/*" /></intent-filter>

2) What are the right parameters in the gradle files? The value was 0 for many of them, as I said.

Regards

Shai Almog

unread,
Jun 21, 2021, 10:24:04 PM6/21/21
to CodenameOne Discussions
I think it's the correct spelling. We were a bit inconsistent in naming over the years.

I'm not sure. I'll ask how this can happen.
Reply all
Reply to author
Forward
0 new messages