problem in code


#1

Hello
Mr Paolo
Your Glucosio app is great. I opened the project file with Android Studio, but did not run and error.
import org.glucosio.android.R;
it does not know " import org.glucosi.android.R". I did not find a file called “R” in project.
Thanks for helping me solve this problem.
Best Regard


#2

Which version of Android Studio and build tools did you use? And which branch of the code? I recently tried Android Studio 3.1. (build 173.4697961) and Build tools 27.0.2. You’ll need SDK version 27 to build. If you have these can you try and do a clean build?


#3

I tried Android Studio 3.1.1 and Build tools 27.0.3. I used clean build and Invalid Cach and Restart but it makes “R” error in MainActivity again.
The Gradle files are shown below:

part of Gradle File:
apply plugin: 'com.android.application’
apply plugin: ‘realm-android’
//apply plugin: 'com.neenbedankt.android-apt’
apply plugin: ‘jacoco’

android {
compileSdkVersion 25

lintOptions {
    abortOnError false
}

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 38
    versionName '1.3.0-FOSS'
    applicationId 'org.glucosio.android'
    vectorDrawables.useSupportLibrary = true
    testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath true
        }
    }
}

dependencies {
compile 'com.google.dagger:dagger:2.13’
annotationProcessor 'com.google.dagger:dagger-compiler:2.0’
implementation 'com.android.support:appcompat-v7:25.2.0’
implementation 'com.android.support:support-annotations:25.2.0’
implementation 'com.android.support:support-v4:25.2.0’
implementation 'com.android.support:support-v13:25.2.0’
implementation 'com.android.support:support-vector-drawable:25.2.0’
implementation 'com.android.support:design:25.2.0’
implementation 'com.android.support:gridlayout-v7:25.2.0’
implementation 'com.android.support:mediarouter-v7:25.2.0’
implementation 'com.android.support:cardview-v7:25.2.0’
implementation 'com.android.support:recyclerview-v7:25.2.0’
implementation 'com.android.support:customtabs:25.2.0’
implementation 'com.android.support:mediarouter-v7:25.2.0’
implementation 'com.android.support:palette-v7:25.2.0’
implementation 'joda-time:joda-time:2.9.3’
implementation ‘org.slf4j:slf4j-android:1.7.7’
}

dependencies {
implementation fileTree(include: [’*.jar’], dir: ‘libs’)

// Android Support libraries
implementation 'com.android.support:appcompat-v7:25.2.0'
implementation 'com.android.support:animated-vector-drawable:25.2.0'
implementation 'com.android.support:design:25.2.0'
implementation ("com.android.support:support-annotations:25.2.0")
implementation 'com.android.support:cardview-v7:25.2.0'
implementation 'com.android.support:recyclerview-v7:25.2.0'
implementation 'com.android.support:percent:25.2.0'

// compile “io.realm:realm-transformer:${version}”
// Other libraries
implementation 'com.github.paolorotolo:expandableheightlistview:1.0.0’
implementation ‘com.github.clans:fab:1.6.2’

implementation 'io.realm:realm-gradle-plugin:5.0.1'
implementation 'com.wdullaer:materialdatetimepicker:3.5.1'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.5'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'net.danlew:android.joda:2.9.3.1'
compile('com.mikepenz:materialdrawer:5.2.9@aar') {
    transitive = true
}

// Butterknife
implementation "com.jakewharton:butterknife:8.8.1"
implementation "com.jakewharton:butterknife-compiler:8.8.1"

testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.17"
testCompile "com.squareup.assertj:assertj-android:1.1.1"
testCompile("org.robolectric:robolectric:3.0-rc2") {
    exclude group: 'commons-logging', module: 'commons-logging'
    exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}

#4

Which branch? (so far I’m using develop)


#5

Sorry I can’t be of more help. I wonder if you should try syncing gradle again? If not, perhaps try and create a small test project (separate from Glucosio) to verify your dev tooling is installed correctly. If you’ve already done that, then perhaps create a fresh clone of the repo and see if that helps?