Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25799] Android: Cannot build titanium project with JDK 1.9 #9964

Merged
merged 4 commits into from Apr 2, 2018

Conversation

ewanharris
Copy link
Collaborator

JIRA: https://jira.appcelerator.org/browse/TIMOB-25799

  • Update to node-appc@0.2.45 to include JDK detection fix
  • Remove java.ext.dirs usage which was removed in JDK 9, see Removed Extension Mechanism on the migration guide. This is compatible with all JDK versions we support (1.8 and above)
  • Also handles JDK 10 which was recently released

Notes

  • This will not cause [appc] ti info -t jdk to detect JDK 9 and above. That fix needs Titanium CLI 5.1.0, which is in Appc CLI 7.0.3-master.23

Verification

  1. Download and install JDK 9/10 from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Build a project using both JDK versions, you can switch using [appc] ti config java.home <PATH>

I've ran through module building and iOS/Windows building also as they use Java in places, there were no issues seen there

@build
Copy link
Contributor

build commented Mar 28, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Mar 28, 2018

@ewanharris , I tried building an android app with this fix but get error while compiling java source files:

[ERROR] :  Failed to compile Java source files:
[ERROR] :  
[ERROR] :  An exception has occurred in the compiler (9.0.4). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
[ERROR] :  java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
[ERROR] :  	at java.base/java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
[ERROR] :  	at java.base/java.time.temporal.ChronoField.checkValidValue(ChronoField.java:714)
[ERROR] :  	at java.base/java.time.LocalDate.of(LocalDate.java:269)
[ERROR] :  	at java.base/java.time.LocalDateTime.of(LocalDateTime.java:336)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipUtils.dosToJavaTime(ZipUtils.java:109)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.cen(ZipFileSystem.java:1950)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.readCEN(ZipFileSystem.java:1937)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getEntry(ZipFileSystem.java:1324)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getFileAttributes(ZipFileSystem.java:312)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipPath.getAttributes(ZipPath.java:721)
[ERROR] :  	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:293)
[ERROR] :  	at java.base/java.nio.file.Files.readAttributes(Files.java:1755)
[ERROR] :  	at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
[ERROR] :  	at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
[ERROR] :  	at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
[ERROR] :  	at java.base/java.nio.file.Files.walkFileTree(Files.java:2749)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:523)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanPlatformPath(ClassFinder.java:673)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:525)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1120)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:810)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:344)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:302)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:162)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
[ERROR] :  	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
[ERROR] Application Installer abnormal process termination. Process exit value was 1

Using java:

java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

OS Ver: 10.13.2
Xcode Ver: Xcode 9.2
Appc NPM: 4.2.12
Appc CLI: 7.0.3-master.23
Daemon Ver: 1.0.1
Ti CLI Ver: 5.1.0
Alloy Ver: 1.11.0
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 9.0.4

@lokeshchdhry
Copy link
Contributor

Above error will be fixed with this ticket https://jira.appcelerator.org/browse/TIMOB-25913

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Mar 29, 2018

FR Passed for OSX.

JDK 9 & 10 is successfully detected & no dexer error seen.

With JDK 9 & crittercism the build fails with an exception & will be fixed here: https://jira.appcelerator.org/browse/TIMOB-25913.

With JDK 10 no build failure is seen.

Studio Ver: 5.1.0
SDK Ver: 7.2.0 local build
OS Ver: 10.13.2
Xcode Ver: Xcode 9.2
Appc NPM: 4.2.12
Appc CLI: 7.0.3-master.23
Daemon Ver: 1.0.1
Ti CLI Ver: 5.1.0
Alloy Ver: 1.11.0
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 9.0.4
Devices: ⇨ google Nexus 5 --- Android 6.0.1
⇨ google Nexus 6P --- Android 8.0.0

@hansemannn hansemannn added this to the 7.2.0 milestone Mar 30, 2018
@longton95
Copy link
Contributor

FR Passed for Windows.

JDK 9 & 10 is successfully detected and builds.

SDK Ver: 7.2.0 local build
Appc NPM: 4.2.12
Appc CLI: 7.0.3-master.24
Node Ver: 8.9.1
NPM Ver: 5.7.1
Java Ver: 9.0.4,10
Android emulator (6.0)
Google Pixel 2 XL (8.1)

@hansemannn
Copy link
Collaborator

@cb1kenobi Can you do the CR?

@cb1kenobi cb1kenobi requested review from lokeshchdhry and removed request for cb1kenobi April 2, 2018 16:33
Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR'd.

@lokeshchdhry lokeshchdhry merged commit a87f2ae into tidev:master Apr 2, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.2.0, 7.3.0 May 16, 2018
@ewanharris ewanharris deleted the TIMOB-25799 branch August 31, 2021 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants