我想执行旧的源代码时遇到严重问题!
当我编辑某些东西时,我会遇到类似
的错误"ERROR: Could not find method implimentation() for arguments [directory 'libs'] on project ':app'. Open File"
或
当我将google()
添加到项目build.gradle
时:
"ERROR: Could not find method google() for arguments [] on repository container.
Open File"
有我的代码:
APP Build gradle:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 24
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.studioninja.antivirus.mobilesecurity"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implimentation fileTree(dir: 'libs', include: ['*.jar'])
testimplimentation 'junit:junit:4.12'
implimentation 'com.android.support:appcompat-v7:24.2.1'
implimentation 'com.android.support:design:24.2.1'
implimentation 'com.android.support:cardview-v7:24.2.1'
implimentation 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
implimentation 'joda-time:joda-time:2.9.6'
implimentation 'com.takwolf.android:lock9view:0.0.11'
implimentation 'org.zakariya.stickyheaders:stickyheaders:0.7.5'
implimentation 'com.github.bumptech.glide:glide:3.7.0'
implimentation 'com.android.support:support-v4:24.2.1'
implimentation 'com.google.firebase:firebase-ads:10.2.0'
implimentation 'com.liulishuo.magicprogresswidget:library:1.0.9'
implimentation "com.mikepenz:crossfadedrawerlayout:1.0.0@aar"
compile('com.mikepenz:materialdrawer:5.5.0@aar') {
transitive = true
}
// used to generate the Open Source section
// https://github.com/mikepenz/AboutLibraries
compile('com.mikepenz:aboutlibraries:5.8.0@aar') {
transitive = true
exclude module: "fastadapter"
}
// icon fonts used inside the sample
// https://github.com/mikepenz/Android-Iconics
implimentation 'com.mikepenz:material-design-iconic-typeface:2.2.0.1@aar'
implimentation 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
}
builde gradle项目:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.propreties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
我正在等待您的帮助,谢谢大家:)
答案 0 :(得分:2)
答案 1 :(得分:1)
我有解决方案,您在哪里使用
implimentation fileTree(dir: 'libs', include: ['*.jar'])
更改为
compile fileTree(dir: 'libs', include: ['*.jar'])