小编Vas*_*lev的帖子

尝试将模块添加到项目。未找到 ID 为“kotlin-android”的插件

我正在尝试将 epub 阅读器库添加到我已经创建的项目中。我试图作为模块添加到我的项目中的库是 Folio Reader Library ( https://github.com/FolioReader/FolioReader-Android )。我已经在我的电脑上下载了这个库,并尝试通过文件 -> 新建 -> 导入模块添加它。但是,在此过程中我收到此错误:

ERROR: Plugin with id 'kotlin-android' not found.
Run Code Online (Sandbox Code Playgroud)

该文件位于 Folio Reader 库的 build.gradle 文件中。

build.gradle 文件:

apply plugin: 'com.android.library'
apply from: '../config/quality/quality.gradle'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

ext {
bintrayRepo = 'maven'
bintrayName = 'folioreader'

publishedGroupId = 'com.folioreader'
libraryName = 'FolioReader'
artifact = 'folioreader'

libraryDescription = 'An epub reader for Android'

siteUrl = 'https://github.com/FolioReader/FolioReader-Android'
gitUrl = 'https://github.com/FolioReader/FolioReader-Android.git'

libraryVersion = versions.folioreaderSdk

developerId = 'mobisystech'
developerName …
Run Code Online (Sandbox Code Playgroud)

android module gradle

7
推荐指数
1
解决办法
6618
查看次数

未解决的参考:getPreferences

我试图存储一个布尔值,每次单击按钮时都会更改该值。我想使用共享首选项来执行此操作,但是我一直遇到此错误:未解析的引用:getPreferences

这是我的代码:

btnStyle.setOnClickListener() {
            styleHasChanged = !styleHasChanged;

            if(styleHasChanged  == true){
                btnStyle.setText("true")
            }else{
                btnStyle.setText("false")
            }

          //  AppUtil.saveConfig(activity, config)
          //  EventBus.getDefault().post(ReloadDataEvent())

          var sharedPref : SharedPreferences = this.getPreferences(Context.MODE_PRIVATE);
            var editor = sharedPref.edit()
            editor.putBoolean("bla", styleHasChanged)
            editor.commit()



        }
Run Code Online (Sandbox Code Playgroud)

android sharedpreferences kotlin

3
推荐指数
2
解决办法
3155
查看次数

标签 统计

android ×2

gradle ×1

kotlin ×1

module ×1

sharedpreferences ×1