Code Monkey home page Code Monkey logo

Comments (4)

getActivity avatar getActivity commented on May 25, 2024

小伙子,这个问题很可能是 Kotlin 版本有冲突了,看一下你的项目 kotlin 版本用的是多少,可以看一下项目根目录 build.gradle 文件的 org.jetbrains.kotlin:kotlin-gradle-plugin 这个插件版本号是多少。

然后将 implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.10' 依赖的版本号修改成你的项目 Kotlin 版本号再试试。

from gsonfactory.

SilasDong avatar SilasDong commented on May 25, 2024

还是不行,原来项目中没有org.jetbrains.kotlin:kotlin-gradle-plugin
给他加了也是不行

buildscript {
repositories {
mavenLocal()
jcenter()
maven {
url "https://maven.aliyun.com/repository/public"
}
maven {
url "https://maven.aliyun.com/repository/google"
}
maven {
url uri("D:\work\fyey\szkj\hw-android\pluginLib\maven")
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
classpath "com.qihoo360.replugin:replugin-plugin-gradle-androidx:2.3.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
}
}

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

android {
compileSdkVersion 28

defaultConfig {
    versionName "1.0.5"
    versionCode 105
    targetSdkVersion 28
    applicationId "cn.smart.hospital"
    minSdkVersion 21
    multiDexEnabled false
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

lintOptions {
    abortOnError false
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

repositories {
flatDir {
dirs 'libs'
}
}

// 这个plugin需要放在android配置之后,因为需要读取android中的配置项
apply plugin: 'replugin-plugin-gradle'

repluginPluginConfig {
appModule = ':app'
pluginName = "cn.smart.hospital" // 内容为该插件包名
hostApplicationId = "com.huawei.smarthome.extend"
hostAppLauncherActivity = "com.huawei.smarthome.login.LauncherActivity"
}

dependencies {
implementation "com.qihoo360.replugin:replugin-plugin-lib-androidx:2.3.4"
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
provided files('libs/fragment.jar')//这个jar就是从Support-fragment中提取出来的并非特制包目的是为了骗过编译期
provided files('libs/common-utils-lib-1.0.0.jar')//这个jar就是从Host的utils中编译生成的,其目的是为了骗过编译期
implementation(name: 'plugin-library', ext: 'aar')//sample:compile aar
// mqtt
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.2'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
// 网络请求框架:https://github.com/getActivity/EasyHttp
implementation 'com.github.getActivity:EasyHttp:12.8'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
// Gson 解析容错:https://github.com/getActivity/GsonFactory
implementation 'com.github.getActivity:GsonFactory:9.5'
// Json 解析框架:https://github.com/google/gson
implementation 'com.google.code.gson:gson:2.10.1'
// Kotlin 反射库:用于反射 Kotlin data class 类对象
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.10'
//基础工具库
implementation 'com.github.tamsiree.RxTool:RxKit:2.6.3'

implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'

}
`
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28

defaultConfig {
    versionName "1.0.5"
    versionCode 105
    targetSdkVersion 28
    applicationId "cn.smart.hospital"
    minSdkVersion 21
    multiDexEnabled false
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

lintOptions {
    abortOnError false
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

repositories {
flatDir {
dirs 'libs'
}
}

// 这个plugin需要放在android配置之后,因为需要读取android中的配置项
apply plugin: 'replugin-plugin-gradle'

repluginPluginConfig {
appModule = ':app'
pluginName = "cn.smart.hospital" // 内容为该插件包名
hostApplicationId = "com.huawei.smarthome.extend"
hostAppLauncherActivity = "com.huawei.smarthome.login.LauncherActivity"
}

dependencies {
implementation "com.qihoo360.replugin:replugin-plugin-lib-androidx:2.3.4"
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
provided files('libs/fragment.jar')//这个jar就是从Support-fragment中提取出来的并非特制包目的是为了骗过编译期
provided files('libs/common-utils-lib-1.0.0.jar')//这个jar就是从Host的utils中编译生成的,其目的是为了骗过编译期
implementation(name: 'plugin-library', ext: 'aar')//sample:compile aar
// mqtt
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.2'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
// 网络请求框架:https://github.com/getActivity/EasyHttp
implementation 'com.github.getActivity:EasyHttp:12.8'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
// Gson 解析容错:https://github.com/getActivity/GsonFactory
implementation 'com.github.getActivity:GsonFactory:9.5'
// Json 解析框架:https://github.com/google/gson
implementation 'com.google.code.gson:gson:2.10.1'
// Kotlin 反射库:用于反射 Kotlin data class 类对象
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.3.72'
//基础工具库
implementation 'com.github.tamsiree.RxTool:RxKit:2.6.3'

implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'

}

from gsonfactory.

getActivity avatar getActivity commented on May 25, 2024

@SilasDong 小伙子,我无法复现你说的这个问题,请提供一个可供复现的 Demo 工程给我。

from gsonfactory.

getActivity avatar getActivity commented on May 25, 2024

超过一个月没有响应,自动关闭此 issue。

from gsonfactory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.