我有一个基于gradle的模块的非gradle android项目。但是,当我尝试使用intellij IDEA 2017.2构建项目时,出现此错误:
android sdk版本为25.0,并且由于办公室中的某些规则和隐私,因此无法访问Internet。
即使我在android studio中尝试了这个项目,也没有机会。
Error:Internal error: (java.lang.ClassNotFoundException) com.android.prefs.AndroidLocation$AndroidLocationException
java.lang.ClassNotFoundException: com.android.prefs.AndroidLocation$AndroidLocationException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.jps.android.AndroidJpsUtil.getAndroidTarget(AndroidJpsUtil.java:404)
at org.jetbrains.jps.android.AndroidJpsUtil.getAndroidPlatform(AndroidJpsUtil.java:480)
at org.jetbrains.jps.android.builder.AndroidPreDexBuildTarget.computeRootDescriptors(AndroidPreDexBuildTarget.java:110)
at org.jetbrains.jps.builders.impl.BuildRootIndexImpl.addRoots(BuildRootIndexImpl.java:72)
at org.jetbrains.jps.builders.impl.BuildRootIndexImpl.<init>(BuildRootIndexImpl.java:62)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:84)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:267)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
答案 0 :(得分:1)
我遇到了同样的问题,然后通过将intellij的想法从2017.2.1降级到2017.1.1解决了这个问题。
此链接可能有帮助:
https://youtrack.jetbrains.com/issue/IDEA-176144#focus=streamItem-27-2337702-0-0