初始化LitePal时遇到的问题
DistinctWind opened this issue · 6 comments
DistinctWind commented
按照README中的说明依次添加了
- build.gradle中的dependencies
dependencies {
implementation 'org.litepal.guolindev:core:3.2.3'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
- 在app/src/main中新建文件夹assets并添加litepal.xml(已粘贴对应内容)
- 在AndroidManifest.xml中配置
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.litepaltest">
<application
android:name="org.litepal.LitePalApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.LitePalTest">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这里就开始有问题了,IDE报错
- 在实际使用当中找不到LitePal
此时已经在litepal.xml中添加了对应关系
报错信息为Cannot resolve symbol 'LitePal'
请问是我遗漏了什么步骤或者哪里做错了吗?还是说有哪些通识性的问题,比如说在gradle添加完某个新的依赖之后还要进行一些特别的设置才能使用?
Fzlkjbk commented
兄弟解决没,我跟你一样是这个问题
DistinctWind commented
并没有解决,现在我是直接用安卓自带的数据库。
学学SQL问题也能解决😂能操控数据库就行
WangLanjue commented
同样的问题没法解决
yukaige commented
添加源
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
解决
Arsun commented
这是来自QQ邮箱的假期自动回复邮件。
您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。