Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何用Android Studio编译 #36

Closed
oncealong opened this issue Mar 23, 2018 · 8 comments
Closed

如何用Android Studio编译 #36

oncealong opened this issue Mar 23, 2018 · 8 comments
Labels

Comments

@oncealong
Copy link

请问如何使用Android Studio 编译?
按照wiki, 使用Android Studio打开, 但是报错.
环境:
com.android.tools.build:gradle:3.0.1
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
报错:

Error:Could not determine the dependencies of task ':app:compileAospReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:aospReleaseCompileClasspath'.
   > Could not resolve project :launcher.
     Required by:
         project :app
      > Unable to find a matching configuration of project :launcher: None of the consumable configurations have attributes.

然后尝试本地下载Launcher3, 加入VirtualXposed, 报错如下:

Error:Unable to resolve dependency for ':app@aospDebug/compileClasspath': Could not resolve project :Launcher3.
<a href="openFile:E:/reverseEngineer/VirtualXposed/VirtualApp/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@aospDebug/compileClasspath&#39;: Could not resolve project :Launcher3.">Show Details</a>
@tiann
Copy link
Member

tiann commented Mar 23, 2018

launcher 是一个submodule,不用单独clone;直接更新submodule即可。

@tiann tiann added the question label Mar 23, 2018
@oncealong
Copy link
Author

以前没有使用过git的module模块, 这里补充下:

clone Submodule

  1. 下载代码时使用git clone https://github.com/android-hacker/VirtualXposed.git --recursive
  2. 先clone父项目,再初始化Submodule.
git clone https://github.com/android-hacker/VirtualXposed.git
cd VirtualXposed\VirtualApp\launcher
git submodule init
git submodule update

但是对VirtualXposed, 这两种方法都会报错, 错误是

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:android-hacker/Launcher3.git' into submodule path 'E:/reverseEngineer/VX/VirtualXposed/VirtualApp/launcher' failed
Failed to clone 'VirtualApp/launcher'. Retry scheduled
Cloning into 'E:/reverseEngineer/VX/VirtualXposed/VirtualApp/launcher'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

这里的错误原因是因为使用了[email protected]:android-hacker/Launcher3.git, 非此项目拥有者没有权限. 我们需要用https://github.com/android-hacker/Launcher3.git替代. 找到.git/config.gitmodules文件, 修改后即可正常clone代码.

参考资料:
https://segmentfault.com/a/1190000003076028
fastio/1store#6

@oncealong
Copy link
Author

导入时报错如下, 请问如何解决? 没有搜到关于me.weishu.exposed:exposed-core的资料.

Error:Failed to resolve: me.weishu.exposed:exposed-core:0.3.6
<a href="openFile:E:/reverseEngineer/tools/VirtualXposed/VirtualApp/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

已根据wiki将exposed-core改为 0.3.6.

@oncealong
Copy link
Author

me.weishu.exposed:exposed-core:0.3.6改为me.weishu.exposed:exposed-core:0.+, 会自动下载0.3.5版本, 所以wiki应该是打错字了. 应该使用me.weishu.exposed:exposed-core:0.3.5

@oncealong
Copy link
Author

make project时又遇到如下错误.

Error:(1447, 21) No resource found that matches the given name: attr 'indicatorName'.
Error:(1446, 21) No resource found that matches the given name: attr 'maxHeight'.
Error:(1444, 21) No resource found that matches the given name: attr 'maxWidth'.
Error:(1445, 21) No resource found that matches the given name: attr 'minHeight'.
Error:(1445, 21) No resource found that matches the given name: attr 'minHeight'.

image

感觉很莫名其妙, 将如下样式注释掉解决, @tiann 请问这个是什么原因导致的.

    <!--<style name="AVLoadingIndicatorView">-->
        <!--<item name="minWidth">48dip</item>-->
        <!--<item name="maxWidth">48dip</item>-->
        <!--<item name="minHeight">48dip</item>-->
        <!--<item name="maxHeight">48dip</item>-->
        <!--<item name="indicatorName">BallPulseIndicator</item>-->
    <!--</style>-->

image

@oncealong
Copy link
Author

接下来make project又遇到错误, 这次更不可思议, 是Epic.collectOffsetInfo()报错, 显示Epic没有collectOffsetInfo()这个方法.
image
不知道是哪个组件使用的me.weishu:epic:0.3.3, 我去看了最新版的Epic https://github.com/tiann/epic/blob/master/library/src/main/java/me/weishu/epic/art/Epic.java, 确实没有找到这个方法.
image

@tiann 请问这个是由于什么导致的?

@tiann
Copy link
Member

tiann commented Mar 24, 2018

拉一下最新的VirtualXposed代码;这部分已经没有用了。

@oncealong oncealong changed the title Android Studio 如何编译 如何用Android Studio编译 Mar 27, 2018
@ygd2013520
Copy link

用AS打开,最后出现如下错误,无法解决
2018-08-15 3 58 37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants