Android的工作室 - MonkeyTalk集成 - 问题 [英] Android Studio - MonkeyTalk Integration - Issues
问题描述
我有格式化后的问题。可有人请相应地编辑的职位。你的帮助是非常AP preciated。
I have problems formatting the post. Can someone please edit the post accordingly. Your help is much appreciated.
也发现了类似的问题的问题 - <一个href=\"http://stackoverflow.com/questions/31676760/android-gradle-monkeytalk-build-issue\">here
Also found a similar problem question - here
我试图整合MonkeyTalk和Android工作室。我下面此链接。当我尝试同步的build.gradle文件app文件夹,我得到以下错误:
I am trying to integrate MonkeyTalk and Android Studio. I am following this link. When i try to sync build.gradle file in app folder, i get the following error:
Error:(37, 0) Gradle DSL method not found: 'monkeytalkCompile()'
Possible causes:<ul><li>The project 'MonkeyTalkTest' may be using a version of Gradle that does not contain the method.
<a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
下面是我做了什么至今:(从上面的链接步骤)
Here is what i have done till now:(as steps from the link above)
步骤:
-
我已经有一个工作的机器人工作室的项目(例如),并从网站下载MonkeyTalkIDEProfessional。
I already have a working android studio project(example) and download MonkeyTalkIDEProfessional from the website.
创建文件夹猴子库内应用程序文件夹,并添加monkeytalk代理-2.0.10.jar'文件到该目录。
Created folder 'monkey-libs' inside 'app' folder and added 'monkeytalk-agent-2.0.10.jar' file to that directory.
增加了以下到的build.gradle的应用程序文件夹内的文件。
Added the following to build.gradle file inside the 'app' folder.
buildscript {结果
库{结果
mavenCentral()结果
}结果
依赖{结果
类路径'com.uphyca.gradle:gradle这个-Android的AspectJ的插件:0.9.5结果
}结果
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.5'
}
}
添加以下行的build.gradle内应用程序文件夹:应用插件:Android的AspectJ的
Added the following line to build.gradle inside 'app' folder: apply plugin: 'android-aspectj'
再次添加以下code到里面的build.gradle应用程序文件夹:
Again added the following code to build.gradle inside 'app' folder:
{相关性搜索
编译文件树(导演:'库',包括:['的的.jar'])结果
monkeytalkCompile文件树(导演:'猴库,包括:的的.jar'])结果
}
dependencies {
compile fileTree(dir: 'libs', include: ['.jar'])
monkeytalkCompile fileTree(dir: 'monkey-libs', include: ['.jar'])
}
在创建SRC文件夹中的文件夹monkeytalk'并添加AndroidManifest.xml文件将它与下面code:
Created a folder 'monkeytalk' in 'src' folder and added AndroidManifest.xml file to it with following code:
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.INTERNET"/>
在这一点上我试图同步的build.gradle文件,我得到前面提到的错误。
At this point i am trying to sync build.gradle file and i get the error mentioned earlier.
如何才能突破这个错误?
How can i get past this error?
编辑:
的build.gradle文件:在app文件夹
build.gradle file: in app folder
apply plugin: 'com.android.application'
apply plugin: 'android-aspectj'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.5'
}
}
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "examplepackage.com.monkeytalktest"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
monkeytalkCompile fileTree(dir: 'monkey-libs')
}
编辑2:
顶级的build.gradle文件:
Top-level build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
项目结构:
编辑3:
我改变了下面应用程序文件夹中的build.gradle文件,以下这链接。同步现在工作正常。当我尝试做./gradlew干净installMonkeyTalk,我得到的错误如下图
I changed the build.gradle file in 'app' folder as below, following this link. The sync works fine now. When i try to do ./gradlew clean installMonkeyTalk, i get the error in the image below.
的build.gradle文件
build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'android-aspectj'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.5'
}
}
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "examplepackage.com.monkeytalktest"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
monkeytalk.initWith(buildTypes.debug)
monkeytalk {
applicationIdSuffix ".monkey"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
//monkeytalkCompile fileTree(dir: 'monkey-libs')
monkeytalkCompile(files("monkey-libs/monkeytalk-agent-2.0.10.jar"))
}
现在,我得到以下错误:
Now, i get the following error:
推荐答案
我也面临同样的问题,采用了不同的AspectJ的插件,而不是uphyca。
不同的AspectJ插件在这里找到: https://github.com/leolin310148/GradleAndroidAspectJPlugin
I also faced same issue and used different AspectJ plugin instead of uphyca. different AspectJ plugin found at: https://github.com/leolin310148/GradleAndroidAspectJPlugin
及其的build.gradle文件使用:
Its Uses in build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.+'
classpath 'me.leolin:android-aspectj-plugin:1.0.7'
}
}
apply plugin: 'com.android.application'
apply plugin: 'me.leolin.gradle-android-aspectj'
更新您的build.gradle文件来尝试这种解决方案,让我知道,如果它的工作原理。至于它为我工作。
Update your build.gradle file to try this solution and let me know if it works. As it worked for me.
所有最优秀的!
这篇关于Android的工作室 - MonkeyTalk集成 - 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!