0

I followed the steps in the website below.

https://developer.dji.com/mobile-sdk/documentation/application-development-workflow/workflow-integrate.html#android-studio-project-integration

And I get lots of "Cannot resolve symbol" error in the following code.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        ActivityCompat.requestPermissions(this,
                new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.VIBRATE,
                        Manifest.permission.INTERNET, Manifest.permission.ACCESS_WIFI_STATE,
                        Manifest.permission.WAKE_LOCK, Manifest.permission.ACCESS_COARSE_LOCATION,
                        Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION,
                        Manifest.permission.CHANGE_WIFI_STATE, Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS,
                        Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SYSTEM_ALERT_WINDOW,
                        Manifest.permission.READ_PHONE_STATE,

                , 1);
    }

I've tried

  1. Invalidate Caches / Restart
  2. Check my SDK version it seems correct.
  3. Build->Clean Project
  4. Check the code in gradle file is " apply plugin: 'com.android.application' "

But none of these fix the problem.

And the version of my Android Studio is 2.3.3.

Here is the code of build.gradle .

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.dji.ImportSDKDemo"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner     "android.support.test.runner.AndroidJUnitRunner"
        // Enabling multidex support.
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
})
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.dji:dji-sdk:4.3.2'
    compile 'com.android.support:multidex:1.0.1'
}

Does anyone knows what's wrong with it? Any idea will be welcome.

lisasuebb
  • 1
  • 2
  • 2
    Possible duplicate of [Cannot resolve Manifest.permission.ACCESS\_FINE\_LOCATION](https://stackoverflow.com/questions/34139048/cannot-resolve-manifest-permission-access-fine-location) – daemmie Oct 24 '17 at 19:03
  • 1
    Thanks very much,this fix some error. But now I still have problem with ActivityCompat and Build. – lisasuebb Oct 31 '17 at 03:02

0 Answers0