Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namespace problem in gradle #414

Open
santy-scripts opened this issue Sep 4, 2024 · 2 comments
Open

namespace problem in gradle #414

santy-scripts opened this issue Sep 4, 2024 · 2 comments

Comments

@santy-scripts
Copy link

i been trying to install MSDK in my android studio, i already configure all reading the documentation but when i run the sample aplication this mistake appears:

Namespace not specified. Specify a namespace in the module's build file: C:\Users\santy\OneDrive\Documentos\DJI-SDKMOBILE\Mobile-SDK-Android-V5\SampleCode-V5\android-sdk-v5-sample\build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

@santy-scripts
Copy link
Author

this is my gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)

defaultConfig {
    applicationId "com.dji.sampleV5.aircraft"
    minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK_VERSION)
    targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
    versionCode 1
    versionName "1.0"
    manifestPlaceholders["API_KEY"] = project.AIRCRAFT_API_KEY
    manifestPlaceholders["GMAP_API_KEY"] = project.GMAP_API_KEY
    manifestPlaceholders["MAPLIBRE_TOKEN"] = project.MAPLIBRE_TOKEN
    ndk {
        //noinspection ChromeOsAbiSupport
        abiFilters 'arm64-v8a'
    }
}

//配置签名信息
signingConfigs {
    release {
        storeFile file(project.STORE_FILE)
        storePassword project.STORE_PASSWORD
        keyAlias project.KEY_ALIAS
        keyPassword project.KEY_PASSWORD
    }
}

buildTypes {
    release {
        minifyEnabled true
        shrinkResources false
        signingConfig signingConfigs.release
    }
    debug {
        minifyEnabled false
        shrinkResources false
    }
}

packagingOptions {
    // 因为mrtc库内部使用了NDK的c++_shared的编译参数
    // 与其他库重复引用了,因此选其中一个即可
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
    freeCompilerArgs += ["-Xjvm-default=all"]
}

//关闭lint
lintOptions {
    checkReleaseBuilds false
    abortOnError false
}

packagingOptions {
    doNotStrip "*/*/libconstants.so"
    doNotStrip "*/*/libdji_innertools.so"
    doNotStrip "*/*/libdjibase.so"
    doNotStrip "*/*/libDJICSDKCommon.so"
    doNotStrip "*/*/libDJIFlySafeCore-CSDK.so"
    doNotStrip "*/*/libdjifs_jni-CSDK.so"
    doNotStrip "*/*/libDJIRegister.so"
    doNotStrip "*/*/libdjisdk_jni.so"
    doNotStrip "*/*/libDJIUpgradeCore.so"
    doNotStrip "*/*/libDJIUpgradeJNI.so"
    doNotStrip "*/*/libDJIWaypointV2Core-CSDK.so"
    doNotStrip "*/*/libdjiwpv2-CSDK.so"
    doNotStrip "*/*/libFlightRecordEngine.so"
    doNotStrip "*/*/libvideo-framing.so"
    doNotStrip "*/*/libwaes.so"
    doNotStrip "*/*/libagora-rtsa-sdk.so"
    doNotStrip "*/*/libc++.so"
    doNotStrip "*/*/libc++_shared.so"
    doNotStrip "*/*/libmrtc_28181.so"
    doNotStrip "*/*/libmrtc_agora.so"
    doNotStrip "*/*/libmrtc_core.so"
    doNotStrip "*/*/libmrtc_core_jni.so"
    doNotStrip "*/*/libmrtc_data.so"
    doNotStrip "*/*/libmrtc_log.so"
    doNotStrip "*/*/libmrtc_onvif.so"
    doNotStrip "*/*/libmrtc_rtmp.so"
    doNotStrip "*/*/libmrtc_rtsp.so"
}

}

dependencies {
/** <-----------------依赖MSDK--------------------> **/
compileOnly deps.aircraftProvided
implementation deps.aircraft

/** <-----------------sample所需--------------------> **/
implementation project(':uxsdk')
implementation deps.appcompat
implementation deps.constraintLayout
implementation deps.aacCommon
implementation deps.aacRuntime
implementation deps.kotlinLib
implementation deps.ktxCore
implementation deps.ktxFrag
implementation deps.ktxNavigation
implementation deps.ktxNavigationUi
implementation deps.recyclerview
implementation deps.legacySupport
implementation deps.lifecycleViewModel
implementation deps.lifecycleLiveData
implementation deps.leakcanary
implementation deps.glide
implementation deps.dynamicanimation
implementation deps.expandedit
implementation deps.rx3Kt
implementation deps.dom
kapt deps.glidecompiler
implementation deps.lynx

}

@dji-dev
Copy link
Contributor

dji-dev commented Sep 5, 2024

Agent comment from yating.liao in Zendesk ticket #116453:

This error points to the AGP you are currently using. What version of AGP are you using?
Is this the version recommended by the sample code?

°°°

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants