这是我的gradle
文件:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
compile files('libs/gcm.jar')
compile project(':libraries:AdvancwWebview')
compile project(':libraries:SamsungBadger')
compile project(':libraries:simple-crop-image-lib')
compile project(path: ':libraries:simple-crop-image-lib')
compile project(':libraries:DropboxChooserSDK')
compile project(':libraries:libraryPullToReferesh')
compile project(':libraries:StandOut')
compile project(':libraries:google-play-services_lib')
compile project(':libraries:ResideMenu')
compile 'com.android.support:support-v4:24.0.0'
compile project(path: ':Simple Facebook')
}
android {
compileSdkVersion 21
buildToolsVersion "21.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
defaultConfig {
multiDexEnabled = true
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
我改变了工作。我有一个在Eclipse中开发的Android代码,现在我必须在android studio中转换这段代码。但是我能够成功地做到这一点,但是当我尝试创建一个apk时,它显示错误。代码正在我的设备上运行。
答案 0 :(得分:0)
尝试将compile 'com.android.support:support-v4:24.0.0'
替换为compile 'com.android.support:appcompat-v7:24.0.0'