Comments (4)
小伙子,这个问题很可能是 Kotlin 版本有冲突了,看一下你的项目 kotlin 版本用的是多少,可以看一下项目根目录 build.gradle
文件的 org.jetbrains.kotlin:kotlin-gradle-plugin
这个插件版本号是多少。
然后将 implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.10'
依赖的版本号修改成你的项目 Kotlin 版本号再试试。
from gsonfactory.
还是不行,原来项目中没有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.
@SilasDong 小伙子,我无法复现你说的这个问题,请提供一个可供复现的 Demo 工程给我。
from gsonfactory.
超过一个月没有响应,自动关闭此 issue。
from gsonfactory.
Related Issues (20)
- json名字中带特殊符表情比如😁(unicode)的数据是否有容错处理 HOT 1
- json名字中带特殊符表情比如😁(unicode)的数据是否有容错处理 HOT 11
- 建议适配kotlin默认值 HOT 19
- 容错范围 HOT 2
- 能否通过getDelegateAdapter方法给所有TypeAdapter都套层代理,出错时直接跳到下一个呢 HOT 8
- [疑惑]:关于readme写的为什么gson解析后,kotlin默认值无效的问题不太对 HOT 10
- [Bug]:com.google.gson.internal.ConstructorConstructor$9.construct (ConstructorConstructor.java:262) HOT 3
- [建议]:Gson 框架转义问题 HOT 2
- [疑惑]:<init> argument 4 has type int, got null, HOT 3
- [建议]:兼容类型不匹配的情况 HOT 33
- [建议]:我想去掉这样的警告打印<init> argument 4 has type int, got null HOT 7
- [疑惑]:GsonFactory反序列化数据量大时速度有点慢 HOT 10
- [疑惑]:9.0升级9.2 HOT 2
- [Bug]:9.0升级9.2 HOT 5
- [Bug]:升级到 9.3 直接无法解析 HOT 5
- [Bug]:从 9.0 升级 9.3 出现崩溃 HOT 21
- 9.0升级9.3[Bug]: HOT 1
- [疑惑]:为啥fastjson解析的是正常的,本框架解析的不一样 HOT 12
- 8.0版本 jitpack无法引用依赖 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsonfactory.