Android Studio 2.0 FileOpUtils Not found

Error:Internal error: (java.lang.ClassNotFoundException) com.android.repository.io.FileOpUtils
java.lang.ClassNotFoundException: com.android.repository.io.FileOpUtils
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at com.android.sdklib.repository.local.LocalSdk.<init>(LocalSdk.java:182)
	at com.android.sdklib.repository.local.LocalSdk.<init>(LocalSdk.java:191)
	at org.jetbrains.jps.android.AndroidBuildDataCache.getSdk(AndroidBuildDataCache.java:145)
	at org.jetbrains.jps.android.AndroidJpsUtil.getAndroidTarget(AndroidJpsUtil.java:403)
	at org.jetbrains.jps.android.AndroidJpsUtil.getAndroidPlatform(AndroidJpsUtil.java:478)
	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:83)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:266)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:42)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)


升级android2.0,运行项目时候报了上面这个错。

解决方法:

使用解压工具打开android-studio\plugins\android\lib\android.jar,使用可以格式化的编辑器(如Notepad++)修改META-INF\plugin.xml,在796行添加repository.jar,如下:

<compileServer.plugin classpath="sdklib.jar;common.jar;jarutils.jar;layoutlib-api.jar;manifest-merger.jar;repository.jar"/>


原文链接:https://code.google.com/p/android/issues/detail?id=195173


你可能感兴趣的:(Android Studio 2.0 FileOpUtils Not found)