Android Studio 3.0으로 업그레이드 한 후에도 프로젝트의 백업이 유지되지만 프로젝트도 업데이트되었습니다. 나는 실험적인 gradle 플러그인의 매우 초기 버전에서 3.0.0 버전으로 업그레이드하는 데 어려움을 겪었지만 많은 문제가있다.gradle-experimental에서 Gradle 3.0.0 업그레이드 : 0.9.3 오류
최상위 레벨의 그라데이션 파일은 절대적으로 좋다고 생각합니다.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
//classpath 'com.android.tools.build:gradle-experimental:0.9.3'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
변경 사항을 적용한 응용 프로그램 gradble 빌드 파일은 내가 변경된 사항을 반영한 것입니다. 그것을 사용에도 불구하고
//apply plugin: 'com.android.model.application'
apply plugin: 'com.android.application'
//model {
android {
buildToolsVersion "26.0.2"
compileSdkVersion 23
defaultConfig {
minSdkVersion 19
targetSdkVersion 19
ndk {
def ffmpeg = "src/main/android/armeabi-v7a/include"
moduleName = "ffplayer3jni"
ldLibs "log", "android", "GLESv2", "dl", "EGL", "z",
"stdc++", "OpenSLES"
//cppFlags.addAll("-std=c++11", "-fexceptions", '-I'+file(ffmpeg),
// "-D __cplusplus=201103L", "-frtti",
// "-D __GXX_EXPERIMENTAL_CXX0X__", "-O2")
cppFlags "-std=c++11", "-fexceptions", "-I${ffmpeg}", "-frtti", "-O2"
stl "gnustl_static"
//abiFilters.addAll("armeabi-v7a")
abiFilters "armeabi-v7a"
}
}
}
android.buildTypes {
release {
minifyEnabled false
proguardFiles.add(file('proguard-rules.pro'))
}
}
repositories {
def loc = "src/main/jniLibs/armeabi-v7a/"
libs(PrebuiltLibraries) {
libavutil {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavutil.so")
}
}
libavcodec {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavcodec.so")
}
}
libavformat {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavformat.so")
}
}
libavfilter {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavfilter.so")
}
}
libpostproc {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libpostproc.so")
}
}
libswresample {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libswresample.so")
}
}
libswscale {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libswscale.so")
}
}
}
}
android.sources {
main {
jni {
dependencies {
library "libavformat" linkage "shared"
library "libavcodec" linkage "shared"
library "libavfilter" linkage "shared"
library "libavutil" linkage "shared"
library "libswscale" linkage "shared"
library "libswresample" linkage "shared"
library "libpostproc" linkage "shared"
}
}
}
}
//}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}
는 원래 Gradle을 파일은 아직 안드로이드 스튜디오 2.3과 협력 :
지금까지 Gradle을 파일로 Error:(25, 0) Could not find method cppFlags() for arguments [-std=c++11, -fexceptions, -Isrc/main/android/armeabi-v7a/include, -frtti, -O2] on object of type com.android.build.gradle.internal.dsl.NdkOptions.
변경 사항은 다음과 같습니다 그것은 현재 약 cppFlags
오류가있는 불평 이전 실험용 플러그인 이 파일은 /이었다된다
apply plugin: 'com.android.model.application'
model {
android {
def ffmpeg = "src/main/android/armeabi-v7a/include"
buildToolsVersion "25.0.3"
compileSdkVersion 25
defaultConfig.with {
minSdkVersion.apiLevel = 19
}
ndk {
moduleName = "ffplayer3jni"
ldLibs.addAll("log", "android", "GLESv2", "dl", "atomic", "EGL",
"z", "stdc++", "OpenSLES")
cppFlags.addAll("-std=c++11", "-fexceptions", '-I'+file(ffmpeg),
"-D __cplusplus=201103L", "-frtti",
"-D __GXX_EXPERIMENTAL_CXX0X__", "-O2")
CFlags.add('-I'+file(ffmpeg))
stl = "gnustl_static"
//stl = "stlport_shared"
abiFilters.addAll("armeabi-v7a")
}
}
android.buildTypes {
release {
minifyEnabled false
proguardFiles.add(file('proguard-android.txt'))
}
}
repositories {
def loc = "src/main/jniLibs/armeabi-v7a/"
libs(PrebuiltLibraries) {
libavutil {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavutil.so")
}
}
libavcodec {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavcodec.so")
}
}
libavformat {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavformat.so")
}
}
libavfilter {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libavfilter.so")
}
}
libpostproc {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libpostproc.so")
}
}
libswresample {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libswresample.so")
}
}
libswscale {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file(loc + "libswscale.so")
}
}
}
}
android.sources {
main {
jni {
dependencies {
library "libavformat" linkage "shared"
library "libavcodec" linkage "shared"
library "libavfilter" linkage "shared"
library "libavutil" linkage "shared"
library "libswscale" linkage "shared"
library "libswresample" linkage "shared"
library "libpostproc" linkage "shared"
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}
그래서 내 질문에, 어떤 변화 나 안드로이드 스튜디오 3.0의 새로운 Gradle을 플러그인 작업이 프로젝트를 얻기 위해해야합니까입니까?
자세히 알 수 있듯이 몇 가지 사항을 변경했습니다. 섹션을 옮겨서 옵션을 변경하여 결국 gradle 스크립트를 통과하게되었습니다. 그러나 이제는 매우 어려워졌습니다.
편집 : 결국 Android Studio 3.0.1에서 처음부터 새로운 프로젝트를 만들었습니다. 많은 인터넷 검색 결과, 모든 네이티브 코드, ffmpeg 라이브러리 및 올바른 빌드를 얻을 수있었습니다.
다음을 수행 했습니까? http://tools.android.com/tech-docs/new-build-system/gradle-experimental/migrate-to-stable? – Yashasvi
2.3에서 새로운 빌드 시스템으로의 업그레이드에 대해서만 개략적으로 설명합니다. 저는 0.9.3에서 3.0.0으로 갈 것입니다. 오래 전에 마지 못해 내 잘못을 저지른 것에 대한 나의 잘못. 새로운 프로젝트를 만들고 모든 것을 복사하는 것을 고려하십시오. – WLGfx