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

适配AS3.0.1相关问题 #136

Closed
sandy1108 opened this issue Feb 8, 2018 · 7 comments
Closed

适配AS3.0.1相关问题 #136

sandy1108 opened this issue Feb 8, 2018 · 7 comments

Comments

@sandy1108
Copy link
Collaborator

sandy1108 commented Feb 8, 2018

依赖新版AppCanGradle插件(beta版)

  1. 修改Engine/gradle/wrapper/gradle-wrapper.properties,其中版本改为4.1;

  2. 修改Engine/build.gradle文件中。其中,repositories增加一个github的maven库,dependencies中将原来的依赖本地的gradle插件改为依赖线上的,版本目前是2.2.3,可以在此仓库关注更新 https://github.com/android-plugin/mvn-repo
    修改部分参考下面:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://raw.githubusercontent.com/android-plugin/mvn-repo/master/'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
//        classpath fileTree(dir: '../gradle-plugin', include: '*.jar')
        classpath 'org.appcan.gradle.plugins:appcan-gradle-plugin:2.2.3'
    }
}
  1. dependencies中com.android.tools.build:gradle设置为3.0.1之后,需要在所有的repositories中增加google(),否则会找不到Android新版的官方gradle相关插件库而报错;

  2. 若buildToolsVersion改为26或更高后,还会要求修改flavor的定义,如下修改即可:

    //声明flavorDimension
    flavorDimensions "kernel"

    productFlavors {
        crosswalk {
            dimension "kernel"
        }
        system {
            dimension "kernel"
        }
        x5 {
            dimension "kernel"
        }
    }
  1. 为了方便开发者使用,修改后的gradle文件已经放在了工程根目录,名为build.gradle.3.0.1,由于在实验阶段,没有替换原有的。
@sandy1108
Copy link
Collaborator Author

升级新版本gradle之后,调试工程可能还会报错,提示uexFileMgr的aar中的一些资源找不到,目前看起来他去寻找的是test的资源,暂时没找到错误原因。如果仅仅是为了修改引擎代码的话,可以把下面代码注释掉:

compile(name: "uexFileMgr-debug", ext: 'aar')

这个仅仅是调试使用,去掉之后由于appcan.js需要用到uexFileMgr,可能的原因就是在Run工程的时候,测试case无法正常使用。但是编译出的引擎包是无影响的。

@sandy1108
Copy link
Collaborator Author

降级gradle(快速解决方案)

修改Engine/gradle/wrapper/gradle-wrapper.properties,其中版本改为2.14.1;其他部分维持原状即可编译通过。

@sandy1108
Copy link
Collaborator Author

占楼用于更新。

@huihuabao123
Copy link

如何支持其他架构下的so呢

@sandy1108
Copy link
Collaborator Author

@huihuabao123 其他架构的so,没有特殊要求的话,我们一般不建议使用,因为涉及到项目中其他引用的插件的so都需要提供相应的架构,第三方库也一样,复杂度较高。如果真的需要的话,只需要找全所有用到的so,加进来就行了。

@sandy1108
Copy link
Collaborator Author

如何支持其他架构下的 so 呢

现在4.4+的引擎已经可以支持v7和64位的so架构了。公共插件也已经升级并适配。

@sandy1108
Copy link
Collaborator Author

适配AS3.5.0的issue:

#162

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

No branches or pull requests

2 participants