gpt4 book ai didi

android - NetBeans Clean and Build Android 错误 : Java. Lang X500Principal access

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:11:09 24 4
gpt4 key购买 nike

我想知道是否有人可以在这方面提供帮助。清理和构建最简单的项目时会发生错误。 (见下文)

导致错误的步骤:

作为一名新员工,因此也是使用不超过 4 个月的机器的新用户,我首先打开 NetBeans 8.2 - 一周前为我安装了 NetBeans 和 Android Studio(用于 sdk)。

但是没有安装Android插件,所以我实现了nandroid更新中心来安装插件。然后,我将位于 users\user.user1\AppData\local\android 文件夹中的 sdk 连接到 NetBeans。

为了运行某个项目的正确 Android 版本 (4.2.2),我首先在 Android Studio/SDK Manager 中安装版本 4 及更高版本,然后在 NetBeans 中选择 4.2.2。

在 NetBeans 中打开本地版本之前,我继续将一个 android 项目从共享文件服务器复制到我的本地计算机。

执行 Clean & Build 后出现以下错误(您可能会注意到有些文件夹结构与上述不同。这是由于测试了不同的配置以找到可能的解决方案):

Current build type is different than previous build: forced apkbuilder run.
Creating Test-debug-unaligned.apk and signing it with a debug key...
C:\AndroidSDK\tools\ant\build.xml:958: The following error occurred while executing this line:
C:\AndroidSDK\tools\ant\build.xml:969: The following error occurred while executing this line:
C:\AndroidSDK\tools\ant\build.xml:312:
java.lang.InternalError: Could not obtain X500Principal access
at sun.security.x509.X500Name.<clinit>(X500Name.java:1399)
at com.android.sdklib.internal.build.SignedJarBuilder.writeSignatureBlock(SignedJarBuilder.java:384)
at com.android.sdklib.internal.build.SignedJarBuilder.close(SignedJarBuilder.java:273)
at com.android.sdklib.build.ApkBuilder.sealApk(ApkBuilder.java:795)
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:371)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: javax.security.auth.x500.X500Principal.<init>(sun.security.x509.X500Name)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.x509.X500Name.<clinit>(X500Name.java:1392)
... 63 more
Caused by: java.lang.NoSuchMethodException: javax.security.auth.x500.X500Principal.<init>(sun.security.x509.X500Name)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at sun.security.x509.X500Name$1.run(X500Name.java:1384)
at sun.security.x509.X500Name$1.run(X500Name.java:1380)

这真的很奇怪,因为我的同事在他的 PC 上编译没有问题(几乎相同的 PC,除了 NetBeans 8.1 和 Jdk8u91 而不是我最新的 java)

已经咨询过的解决方案:

  • 更改 Android SDK、JDK 和所有相关的位置应用程序,
  • 插入环境变量,例如 ANT_HOME,JAVA_HOME 和 ANDROID_HOME,
  • 安装所有插件和安卓版本,

  • 将环境变量路径插入 Jdk,

  • 在android studio中只安装4.2.2版本的android,

  • 以 Pc 的管理员身份完全卸载并重新安装 NetBeans、Android Studio、JDK、Android SDK,

  • 使用我的同事作为用户,

  • 清理和构建一个简单的启动项目,

  • 设置与同事相同的 NetBeans 输入,

  • 深入探索 Google

我已经检查了权限并略微研究了 Java Principals and Tools,但不能 100% 确定我在用它做什么。

我想在尝试其他任何事情之前先咨询堆栈。感谢您的帮助。

最佳答案

插件 nandroid 与 NetBeans 8.2 不兼容,根据 wiki 说明它适用于 NetBeans 8.1 nbandroid wiki在 nandroid 插件网站上也记录了一个针对相同问题的错误 here .

一旦他们更新了插件以使用较新版本的 NetBeans,我希望这个问题能够得到解决。

关于android - NetBeans Clean and Build Android 错误 : Java. Lang X500Principal access,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40041658/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com