运行混淆的jar后出现以下错误:
引起:java.io.UncheckedIOException:加载FXML时出错:/fxml/main.fxml
引起:javafx.fxml.LoadException: 未知路径
但FXML文件存在于指定的路径上。
我的ProGuard配置文件包含以下规则:
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod,javafx.fxml.FXML
-adaptresourcefilenames **.fxml,**.png,**.css,**.pdf,**.ttf,**.otf,**.txt
-adaptresourcefilecontents **.png,**.css,**.pdf,**.ttf,**.otf,**.txt
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF
-adaptclassstrings
-keepclassmembernames class * {@FXML *;}
答案 0 :(得分:0)
这个问题是重复的;以下是这个问题的答案:
问题是FXML无法导入不以大写字母开头的类。因此,必须提供ProGuard用于混淆的可用名称列表。