android源代码上的Telegram源代码提供了' java.lang.UnsatisfiedLinkError:'

时间:2016-02-03 09:35:39

标签: android android-ndk android-gradle telegram

当我在android studio中运行Mac中的最新电报源时,我收到此错误 -

java.lang.UnsatisfiedLinkError: No implementation found for void org.telegram.tgnet.ConnectionsManager.native_setJava(boolean) (tried Java_org_telegram_tgnet_ConnectionsManager_native_1setJava and Java_org_telegram_tgnet_ConnectionsManager_native_1setJava__Z)
            at org.telegram.tgnet.ConnectionsManager.native_setJava(Native Method)
            at org.telegram.messenger.ApplicationLoader.onCreate(ApplicationLoader.java:266)

我应用了此处给出的解决方案 - Android Telegram App --> java.lang.UnsatisfiedLinkError: No implementation found for void,但没有成功。

我甚至在Mac上下载并安装了最新的NDK。这可能是什么问题?

build.gradle(Module:TMessagesProj)

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    jcenter()
}

task nativeLibsToJar(
    type: Zip,
    description: 'create a jar archive of the native libs') {
    destinationDir file("$buildDir/native-libs")
    baseName 'native-libs'
    extension 'jar'
    from fileTree(dir: 'libs', include: '**/*.so')
    into 'lib/'
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn(nativeLibsToJar)
}

dependencies {
    compile 'com.android.support:support-v4:23.1.+'
    compile 'com.googlecode.mp4parser:isoparser:1.0.+'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
}

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

    useLibrary 'org.apache.http.legacy'
    defaultConfig.applicationId = "org.telegram.messenger"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    signingConfigs {
        debug {
            storeFile file("config/debug.keystore")
        }

        release {
            storeFile file("config/release.keystore")
            storePassword "none"
            keyAlias "RELEASE_KEY_ALIAS"
            keyPassword "RELEASE_KEY_PASSWORD"
        }
    }

    buildTypes {
        debug {
            debuggable true
            jniDebuggable true
            signingConfig signingConfigs.debug
        }
        release {
            debuggable false
            jniDebuggable false
            signingConfig signingConfigs.debug
        }
        foss {
            debuggable false
            jniDebuggable false
            signingConfig signingConfigs.release
        }
    }



    sourceSets.debug {
        manifest.srcFile 'config/debug/AndroidManifest.xml'
    }

    sourceSets.release {
        manifest.srcFile 'config/release/AndroidManifest.xml'
    }

    sourceSets.foss {
        manifest.srcFile 'config/foss/AndroidManifest.xml'
    }

    defaultConfig {

        minSdkVersion 10
        targetSdkVersion 23
        versionCode 719
        versionName "3.4.2"

    }
}

1 个答案:

答案 0 :(得分:1)

当我尝试在Intellij想法中打开项目时,我也遇到了这个错误,后来我安装了最新版本的Android工作室和我升级了Gradel以及sdk管理器中所需的存储库,之后所有的错误都消失了 - 但请记住,在索引时不要尝试做任何事情。