【问题标题】:How to deploy gluon mobile project to iPhone with MacBook如何使用 MacBook 将 gluon 移动项目部署到 iPhone
【发布时间】:2018-03-29 12:38:25
【问题描述】:

我们尝试使用免费的 Apple 开发者帐户将我们编写的应用程序部署到 iOS 设备上。 为了部署我们从 gradle 任务“ios”开始的项目,但这总是显示很多警告并且永远不会结束...... 警告通常包括“java.awt.*”,而星号代表类名。但是,我们只是在 JavaFX 中编码,我们再次检查是否使用任何 awt 类......但我们没有。

我们还尝试运行“launchIPhoneSimulator”和“launchIOSDevice”,但完全没有成功。

Java SDK 版本为 1.8_151,使用 gluon down 3.6.0,charm down 版本 2.0.1,javafxports:jfxmobile-plugin:1.3.8。

MacBook Pro(2015 年初,i7,16 GB RAM)High Sierra 与运行 iOS 11.0.3 的 iPhone 6 结合使用。

关于我们做错了什么的任何提示? 任何帮助表示赞赏:-)

编辑:这是控制台输出:

14:16:29: Executing external task 'ios'...
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:createDefaultIOSLauncher UP-TO-DATE
:compileIosJava UP-TO-DATE
:processIosResources UP-TO-DATE
:iosClasses UP-TO-DATE
:iosExtractNativeLibs UP-TO-DATE
:createIpa
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
Warning: javax.xml.bind.annotation.XmlRootElement is a phantom class!
Warning: java.nio.file.StandardOpenOption is a phantom class!
Warning: java.nio.file.FileSystem is a phantom class!
Warning: java.nio.file.OpenOption is a phantom class!
Warning: java.nio.file.FileSystems is a phantom class!
Warning: com.oracle.jrockit.jfr.TimedEvent is a phantom class!
Warning: com.oracle.jrockit.jfr.EventToken is a phantom class!
Warning: com.oracle.jrockit.jfr.ValueDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.EventDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.Producer is a phantom class!
Warning: com.oracle.jrockit.jfr.FlightRecorder is a phantom class!
Warning: sun.nio.ch.DirectBuffer is a phantom class!
Warning: java.util.stream.Stream is a phantom class!
Warning: java.awt.Font is a phantom class!
Warning: java.awt.Graphics2D is a phantom class!
Warning: java.awt.image.BufferedImage is a phantom class!
Warning: java.awt.MultipleGradientPaint$CycleMethod is a phantom class!
Warning: java.awt.geom.AffineTransform is a phantom class!
Warning: java.awt.geom.Path2D is a phantom class!
Warning: java.awt.geom.Rectangle2D$Float is a phantom class!
Warning: java.awt.geom.Ellipse2D is a phantom class!
Warning: java.awt.geom.RoundRectangle2D is a phantom class!
Warning: java.awt.geom.Line2D is a phantom class!
Warning: java.awt.geom.Rectangle2D is a phantom class!
Warning: java.awt.Color is a phantom class!
Warning: java.awt.Paint is a phantom class!
Warning: java.awt.Stroke is a phantom class!
Warning: java.awt.Rectangle is a phantom class!
Warning: java.awt.Shape is a phantom class!
Warning: java.awt.AlphaComposite is a phantom class!
Warning: java.awt.image.SampleModel is a phantom class!
Warning: java.awt.image.DataBufferInt is a phantom class!
Warning: java.awt.image.Raster is a phantom class!
Warning: java.awt.image.SinglePixelPackedSampleModel is a phantom class!
Warning: java.awt.image.WritableRaster is a phantom class!
Warning: java.awt.image.DataBuffer is a phantom class!
Warning: java.awt.GraphicsEnvironment is a phantom class!
Warning: java.awt.geom.Line2D$Float is a phantom class!
Warning: java.awt.MultipleGradientPaint is a phantom class!
Warning: java.awt.geom.Path2D$Float is a phantom class!
Warning: java.awt.BasicStroke is a phantom class!
Warning: java.awt.font.GlyphVector is a phantom class!
Warning: java.awt.LinearGradientPaint is a phantom class!
Warning: java.awt.geom.Point2D$Float is a phantom class!
Warning: java.awt.font.FontRenderContext is a phantom class!
Warning: java.util.concurrent.ConcurrentHashMap$KeySetView is a phantom class!
Warning: java.awt.RenderingHints$Key is a phantom class!
Warning: java.awt.GradientPaint is a phantom class!
Warning: java.awt.geom.Point2D is a phantom class!
Warning: java.awt.RenderingHints is a phantom class!
Warning: java.awt.image.ImageObserver is a phantom class!
Warning: java.awt.geom.NoninvertibleTransformException is a phantom class!
Warning: java.awt.Composite is a phantom class!
Warning: java.awt.Image is a phantom class!
Warning: java.awt.Graphics is a phantom class!
Warning: java.awt.geom.Ellipse2D$Float is a phantom class!
Warning: java.awt.TexturePaint is a phantom class!
Warning: java.awt.geom.RoundRectangle2D$Float is a phantom class!
Warning: java.awt.geom.PathIterator is a phantom class!
Warning: java.awt.PaintContext is a phantom class!
Warning: java.awt.image.ColorModel is a phantom class!
Warning: java.awt.geom.GeneralPath is a phantom class!
Warning: java.awt.image.DataBufferByte is a phantom class!
Warning: java.awt.geom.Point2D$Double is a phantom class!
Warning: java.awt.geom.Area is a phantom class!
Warning: javax.print.attribute.AttributeSet is a phantom class!
Warning: javax.print.PrintService is a phantom class!
Warning: javax.print.DocFlavor is a phantom class!
Warning: javax.print.PrintServiceLookup is a phantom class!
Warning: java.awt.print.PrinterJob is a phantom class!
Warning: javax.print.attribute.PrintRequestAttributeSet is a phantom class!
Warning: javax.print.attribute.standard.SheetCollate is a phantom class!
Warning: javax.print.attribute.standard.Chromaticity is a phantom class!
Warning: javax.print.attribute.standard.OrientationRequested is a phantom class!
Warning: javax.print.attribute.standard.PrinterResolution is a phantom class!
Warning: javax.print.attribute.standard.PrintQuality is a phantom class!
Warning: javax.print.attribute.standard.Media is a phantom class!
Warning: javax.print.attribute.standard.MediaTray is a phantom class!
Warning: javax.print.attribute.standard.MediaSizeName is a phantom class!
Warning: java.awt.print.Pageable is a phantom class!
Warning: java.awt.print.Printable is a phantom class!
Warning: javax.print.attribute.standard.CopiesSupported is a phantom class!
Warning: javax.print.attribute.HashPrintRequestAttributeSet is a phantom class!
Warning: javax.print.attribute.ResolutionSyntax is a phantom class!
Warning: javax.print.attribute.standard.Copies is a phantom class!
Warning: javax.print.attribute.standard.Sides is a phantom class!
Warning: javax.print.attribute.standard.MediaPrintableArea is a phantom class!
Warning: java.awt.print.PageFormat is a phantom class!
Warning: javax.print.attribute.standard.MediaSize is a phantom class!
Warning: javax.print.attribute.standard.PageRanges is a phantom class!
Warning: javax.print.attribute.Attribute is a phantom class!
Warning: javax.print.attribute.Size2DSyntax is a phantom class!
Warning: java.awt.print.PrinterException is a phantom class!
Warning: javax.print.attribute.standard.DialogTypeSelection is a phantom class!
Warning: java.awt.Transparency is a phantom class!
Warning: java.awt.image.DirectColorModel is a phantom class!
Warning: java.awt.print.Paper is a phantom class!
Warning: java.nio.file.FileSystemNotFoundException is a phantom class!

https://pastebin.com/VbEQdXyy

编辑:已解决 - 如果您确实有同样的问题,请按照以下 cmets 中的步骤操作。

【问题讨论】:

  • “永无止境”意味着您第一次必须运行提前编译器并编译所有内容(可能需要大约 20 分钟)。之后,下一次运行大约需要一分钟。控制台输出不完整,并没有真正显示实际错误。让流程完成并发布更完整的输出。
  • 我们确实让它运行了半个小时,没有任何结果。早在去年 11 月,我们确实让它在 MacBook Air 上运行了几个小时——在一台非常旧的机器上也运行了 4 个小时。它通常会一直运行,直到发生内存不足异常。您有什么建议或我们可以通过什么方式提供更多信息?
  • 首先,我将从 Gluon IDE 插件的一个新模板项目开始(即单视图项目,但不是具有 Gluon VM 的项目)。这将包含所有必需依赖项的最新版本。然后我会尝试为iOS编译它。我建议您将 JVM 内存增加到 4GB (-Xmx4g)。在上述 Mac 上,编译时间不应超过 20 分钟。如果内存不足,再试一次(下一次运行会更短,全部缓存)。
  • 当它工作时,您将不得不处理 iOS 配置。最简单的方法是首先尝试模拟器,因为它不需要配置。要部署到 iOS 设备,您应该首先使用相同的包名称(相同的包名称)创建一个 Xcode 项目,然后部署它:这将在设备上安装一个配置文件,稍后在您部署应用程序时使用它.
  • 如果您没有正确设置 VM 选项:将其添加到您的 ~/.gradle/gradle.properties 文件中:org.gradle.jvmargs=-Xms256m -Xmx4096m -Xss2m,保存并重试。

标签: ios xcode deployment gluon gluon-mobile


【解决方案1】:

您为什么对我们隐藏最重要的信息? *s 可能会提示出现了什么问题。一些 JavaFX 类在内部使用 AWT。例如打印。你的代码中有这样的东西吗?

【讨论】:

  • 这应该是评论:)
  • 我们的目的不是隐藏信息,只是在控制台中太多了。但这里是:pastebin.com/VbEQdXyy 是的,我们使用打印......这很糟糕吗?
  • JavaFX 打印使用 AWT,据我所知,移动插件不支持此功能。因此,请尝试摆脱此代码并重试。
  • 感谢推荐!你会推荐什么作为替代方案?我们使用“printWriters”来编写我们应用程序的导出,之后可以共享 - 显然它在 Android 上运行良好......
  • 堆栈跟踪中没有任何内容表明正在使用 AWT。 “stacktrace”不完整,并没有真正显示实际错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-16
  • 2011-12-28
  • 2012-08-20
  • 1970-01-01
  • 2018-01-23
  • 2018-02-17
  • 1970-01-01
相关资源
最近更新 更多