如何使用android studio进行导入和运行项目

时间:2014-12-17 05:23:57

标签: java android telegram

我从github下载项目,我想将其导入android studio。我试了几次,但我不能跑。任何人都可以逐步指导导入项目,因为这是android studio的新功能。


Showing Error:

    "C:\Program Files\Java\jdk1.8.0_25\bin\java" -ea -Didea.launcher.port=7532 -Didea.launcher.bin.path=D:\Users\SYS\AppData\Local\Android\android-studio\bin -Dfile.encoding=UTF-8 -classpath "D:\Users\SYS\AppData\Local\Android\android-studio\lib\idea_rt.jar;D:\Users\SYS\AppData\Local\Android\android-studio\plugins\junit\lib\junit-rt.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\android.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\data\res;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\tools\support\annotations.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 @C:\Users\SYS\AppData\Local\Temp\idea_junit7097204602616052537.tmp @w@C:\Users\SYS\AppData\Local\Temp\idea_working_dirs_junit3836436993075423504.tmp -socket54727
    Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:260)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
    Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
        at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 3 more

    Process finished with exit code 1

现在我收到了错误:

11:51:25 UnsupportedMethodException Failed to set up Android modules in project 'Telegram-master': Unsupported method: SourceProvider.getJniDirectories(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you connect to. Alternatively, you can ignore this exception and read other information from the model.

1 个答案:

答案 0 :(得分:-1)

我试过,这是步骤:

  1. Git将项目克隆到您的磁盘
  2. 在Android Studio上导入项目。
  3. 有一个gradle错误。将gradle版本更改为最新的1.0.0,这样 " classpath' com.android.tools.build:gradle:1.0.0'
  4. 获取您自己的api_id表单here
  5. 关注doc
  6. 修改

    对于'signingConfig.storeFile' does not exist问题:

    1:看看你是否有(〜/ .android中的debug.keystore或搜索你的整个android文件夹)。如果你还没有得到它。查看此(There is no debug.keystore in .android folder)以创建debug.keystore。

    2:当你有文件时。您必须在(Telegram / TMessagesProj / config)上复制文件(' debug.keystore')。