Не удается разрешить "базу данных" символов в импорте net.sqlcipher в Android Studio

Любая идея, почему у меня это, не может разрешить «базу данных» символов в net.sqlcipher. Я просто клонировал Тест SQLCipher для Android из GitHub и хотел протестировать.

также приложили снимок экрана для справки. Не удается разрешить "базу данных" символов в импорте net.sqlcipher в Android Studio

Спасибо...

синхронизировать Gradle, очистить и перестроить проект

user3403807 10.08.2018 10:31

Поделись своим градиентом

Pankaj Kumar 10.08.2018 10:35

это будет его градл raw.githubusercontent.com/sqlcipher/sqlcipher-android-tests/‌…

Min Soe 10.08.2018 10:59
1
3
1 068
2
Перейти к ответу Данный вопрос помечен как решенный

Ответы 2

import net.sqlcipher.database.SQLiteDatabase;
import net.sqlcipher.database.SQLiteOpenHelper;

НЕ

import android.database.Cursor;

ДЕЛАТЬ

 import net.sqlcipher.Cursor;

Вы должны использовать

Для раздела app/build.gradle

   compile (name: 'android-database-sqlcipher-3.5.9', ext: 'aar')

Добавьте ниже файл build.gradle проекта

  repositories {
     jcenter()
    }

Затем File-> Sync Project with Gradle Files & Clean->Rebuild Project.

Прочитать SQLCipher for Android Application Integration

К вашему сведению

We initially tested adding Java 8 support via the Jack toolchain. Over time, we realized the cost of switching to Jack was too high for our community when we considered the annotation processors, bytecode analyzers and rewriters impacted. Thank you for trying the Jack toolchain and giving us great feedback. You can continue using Jack to build your Java 8 code until we release the new support. Migrating from Jack should require little or no work.

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

о, я все еще использую старую версию Gradle. так что это compile 'net.zetetic:android-database-sqlcipher:3.5.9@aar вместо implementation. В остальном то же самое.

Min Soe 10.08.2018 10:53

@MinSoe сначала импортирует import net.sqlcipher.Cursor;

IntelliJ Amiya 10.08.2018 10:53

это то же самое. под net.sqlcipher ничего нет

Min Soe 10.08.2018 10:58

@MinSoe добавить compile (name: 'android-database-sqlcipher-3.5.9', ext: 'aar')

IntelliJ Amiya 10.08.2018 11:08

@MinSoe После изменения Перезагрузите IDE.

IntelliJ Amiya 10.08.2018 11:09
Ответ принят как подходящий

Теперь я могу скомпилировать после того, как добавил compileOptions как JavaVersion 8 и включил JACK

compileOptions {
  sourceCompatibility JavaVersion.VERSION_1_8
  targetCompatibility JavaVersion.VERSION_1_8
}

Jack Options добавлен внутри defaultConfig

jackOptions {
  enabled true
}

Теперь мой app/build.gradle стал таким.

apply plugin: 'com.android.application'

android {
  compileSdkVersion 26
  buildToolsVersion "26.0.1"
  defaultConfig {
    applicationId "net.zetetic.sqlcipher.test"
    minSdkVersion 14
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    jackOptions {
     enabled true
    }
 }
buildTypes {
 release {
  minifyEnabled false
  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 }
}

compileOptions {
 sourceCompatibility JavaVersion.VERSION_1_8
 targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

// For testing zip-based distributions:
//compile files('libs/sqlcipher.jar')


 // For testing AAR packages:
 compile 'net.zetetic:android-database-sqlcipher:3.5.9@aar'
}

Большое спасибо за вашу помощь, ребята.

Рад видеть вас исправленным. Можно отключить jackOptions. Я думал, вы добавили JAVA 8. Прочтите developer.android.com/studio/write/…

IntelliJ Amiya 14.08.2018 09:34

да. мой был в Gradle 2. После обновления до Gradle 3 я смог удалить jackOptions

Min Soe 14.08.2018 09:44

Другие вопросы по теме