First at all: I copy and paste these question from my 'off topic' post into android enthusiast. Someone suggest me to ask here for these.

I try to install on my lollipop device AppRTCMobile example containing on official repo.

i find a first little error on grandle.build file (not closing "}").Actually I obtain these error on my log file:

WARN - ect.sync.idea.ProjectSetUpTask - Could not get unknown property 'vectorDrawables' for source set default config of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.Consult IDE log for more details (Help | Show Log) 2018-02-13 13:07:01,478 [d thread 6] INFO - e.project.sync.GradleSyncState - Gradle sync failed: Could not get unknown property 'vectorDrawables' for source set default config of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.

my build.grandle result these:

// Generated by //build/android/generate_gradle.pybuildscript {repositories {jcenter()maven {url 'https://maven.google.com'}}dependencies {classpath "com.android.tools.build:gradle:3.1.0-alpha08"} }

and my example AppRTCMobile build.grandle result these:

// Generated by //build/android/generate_gradle.pyapply plugin: "com.android.application"android {compileSdkVersion "android-27"buildToolsVersion "27.0.1"compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}sourceSets {main {aidl.srcDirs=[]assets.srcDirs=[]java.srcDirs=[]jni.srcDirs=[]renderscript.srcDirs=[]res.srcDirs=[]resources.srcDirs=[]}test {aidl.srcDirs=[]assets.srcDirs=[]java.srcDirs=[]jni.srcDirs=[]renderscript.srcDirs=[]res.srcDirs=[]resources.srcDirs=[]}androidTest {aidl.srcDirs=[]assets.srcDirs=[]java.srcDirs=[]jni.srcDirs=[]renderscript.srcDirs=[]res.srcDirs=[]resources.srcDirs=[]}debug {aidl.srcDirs=[]assets.srcDirs=[]java.srcDirs=[]jni.srcDirs=[]renderscript.srcDirs=[]res.srcDirs=[]resources.srcDirs=[]}release {aidl.srcDirs=[]assets.srcDirs=[]java.srcDirs=[]jni.srcDirs=[]renderscript.srcDirs=[]res.srcDirs=[]resources.srcDirs=[]}main {manifest.srcFile "http://stackoverflow.com/http://stackoverflow.com/http://stackoverflow.com/examples/androidapp/AndroidManifest.xml"java.srcDirs=["extracted-srcjars",]java.filter.exclude()jniLibs.srcDirs=["symlinked-libs",]res.srcDirs=["extracted-res",]}defaultConfig {vectorDrawables.useSupportLibrary=true} }dependencies {implementation project(path: ":examples.AppRTCMobile_javalib")implementation project(path: ":rtc_base.base_java")implementation project(path: ":base.base_java")} afterEvaluate {def tasksToDisable=tasks.findAll {return (it.name.equals('generateDebugSources') // causes unwanted AndroidManifest.java|| it.name.equals('generateReleaseSources')|| it.name.endsWith('BuildConfig') // causes unwanted BuildConfig.java|| it.name.equals('preDebugAndroidTestBuild')|| it.name.endsWith('Aidl')|| it.name.endsWith('Renderscript')|| it.name.endsWith('Shaders'))}tasksToDisable.each { Task task ->task.enabled=false} }

Why I got these error? My buld.grandle on AppRTCMobile is wrong or contain some error??

UPDATE:

I try to clear project and import only AppRTCMobile example .... multiple error only about vectorDrawable: choice 1) comment out "vectorDrawables.useSupportLibrary=true" line in every build file of project. Choice 2) utilize the right library (more than 23.x) and set min support sdk api to 21 instead 16.

I use chose 1). result these error:

/home/myoffice/chromium/src/out/DebugArm/gradle/examples/AppRTCMobile/build/generated/source/r/debug/org/appspot/apprtc/R.javaError:(10, 14) error: duplicate class: org.appspot.apprtc.R

obviusly refactor that class not work. These error type where came from?

regardsbkt

  • I have the same issue. Found that one } is skipped in all gradle files generated. This is } that should close the "sourceSets" block (after the second "main" block). But I also get this error "duplicate class: org.appspot.apprtc.R". Have you solved this?– AnastasiaMar 1 at 12:43
  • 1
    yes but not remember how. I'm out of office now foe4-5 day. After can update this post.– theman whosoldtheworldMar 10 at 15:39
  • Could you please answer your question? I've even opened a bounty with +100 reputation :)– AnastasiaMar 16 at 12:28
  • Finally I've also fixed "duplicate class: org.appspot.apprtc.R" error - just removed extracted-srcjars directory from generated gradle/examples/AppRTCMobile folder.– AnastasiaMar 19 at 14:06
up vote1down voteaccepted
+100

grandle scripts file SECTION:grandle-wrapper.properties file change to:

#Thu Nov 16 19:42:05 CST 2017distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distszipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/distsdistributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

build.grandle(project.....) file:

// 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:3.0.1'// 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}

build.grandle(app) file:

apply plugin: 'com.android.application'android {compileSdkVersion 26defaultConfig {applicationId "org.appspot.apprtc"minSdkVersion 18targetSdkVersion 22versionCode 1versionName "1.0"testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}buildTypes {release {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}sourceSets.main {jniLibs.srcDir 'libs'jni.srcDirs=[] //disable automatic ndk-build call}compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}}dependencies {implementation fileTree(dir: 'libs', include: ['*.jar'])implementation 'com.android.support.constraint:constraint-layout:1.0.2'testImplementation 'junit:junit:4.12'androidTestImplementation 'com.android.support.test:runner:1.0.1'androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'}

after these the error disappear .... but is not tested on my device lollipop, since I'm not a genius in java, I've gone fork another project and checked why that worked while webrtc official no. So on my lollipop now run the fork project + all my changes and I no longer tried webrtc official example that otherwise was too rich in useless things for my application.After these Android Studio now accept to sync and run the webrtc wxample official.

p.s. real sorry for my late reply ... but I was out of office until friday.

regardsbkt

    You have to write this line of code in app level gradle file.

    enter code here defaultConfig {applicationId "com.a3dapp"minSdkVersion 15targetSdkVersion 27versionCode 1versionName "1.0"multiDexEnabled truevectorDrawables.useSupportLibrary=truetestInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}

      Your Answer

       

      By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

      Not the answer you're looking for? Browse other questions tagged or ask your own question.