I tried integrating SQLCipher in my Android Application, using this link and also some stack-overflow links(but they are out-dated and differs from official document).
All the steps are correctly followed, and there is no error in the coding part. But at last, when I build the project, the error message I get is :
Error:(11, 0) Gradle DSL method not found: 'defaultConfig()'
Possible causes:The project 'android-database-sqlcipher-master1' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
Can anyone please help me to get rid of this error.
add this to your build.gradle of your app and it should work out of the box:
dependencies {
compile 'net.zetetic:android-database-sqlcipher:3.5.2#aar'
...
}
In your code, you should load the 'native libraries' as this 'aar' file contains a few of them.
SQLiteDatabase.loadLibs(context);
NOTE that you should use the net.sqlcipher.database.SQLiteDatabase instead of android.database.sqlite.SQLiteDatabase, just like a couple of other SQLite classes.
Related
I have a react-native project in which I want to use firebase notification. I found react-native-firebase as a most popular library to do that. The problem is after installing the last version of react-native-firebase, the project cannot be build because of the mismatch between my project gradle version (It's a guess) and react-native-firebase. Also I cannot add other configurations to build.gradle file.
Error:
* Where:
Build file '/home/hassan/Documents/project/ems/reactApp/node_modules/react-native-firebase/android/build.gradle' line: 3
* What went wrong:
A problem occurred evaluating project ':react-native-firebase'.
> Could not find method google() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
As I'm not so expert with android studio and gradle, I cannot come up with an idea to figure it out. To put in the nutshell my questions are:
I installed the last version of the android studio and react native. why the build.gradle file looks old (e.g I can see compile instead of implementation).
How can I upgrade my react-native project to use last configurations of gradle?
Should I use an environment variable to specify the last version of gradle?
Update distributionUrl in gradle-wrapper.properties (android/gradle/wrapper/gradle-wrapper.properties)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Also, make sure to follow the installation steps in the following link https://rnfirebase.io/docs/v4.3.x/installation/android
I want reading an open source project so I select k9mail for start. The recommendation was run and reading this code in Android Studio. I import k9mail project to AS 1.2.1.1 version. I download gradle 2.4 version and added this in environment variable. When I want to run this application, but I receive some errors that I describe below:
1) When I click Run (Alt+Shift+F10), select Android Application, select my module (there is k9mail) and select USB Device, then I see a warning:
No JDK specified for module 'k-9-master'.
2) When I click on Run (Shift+F10), I faced this error in messages tab:
Gradle DSL method not found: 'android()'
Possible causes:
A)The project 'k-9-master' may be using a version of Gradle that does not contain the method.Open Gradle wrapper file
B)The build file may be missing a Gradle plugin. Apply Gradle plugin
When I updated gradle to 2.4, I changed classpath 'com.android.tools.build:gradle:1.2.3' to 'classpath 'com.android.tools.build:gradle:2.4'' from build.gradle of k9mail, but my problems were not solved.
I googled but I can't find solutions for my problems.
No jdk specified for the module.
For that you have to specify the jdk path through Project Structure.
You may also verify by looking at local.properties
For gradle related issues you just kindly update your gradle build and SDKs to latest versions.
This will minimize your gradle issues.
Im trying to get sinch going, and I am following their tutorial form here.
https://www.sinch.com/tutorials/android-messaging-tutorial-using-sinch-and-parse/
step one is download the skelton and do the gradle build, however first error was unsporrted version of gradle. android studio fixed it automatically and re-imported. and then i get this error:
Error:(15, 0) Gradle DSL method not found: 'runProguard()'
Possible causes:The project 'messenger' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
I'm new to android programming and android studio, so I'm kinda lost. How can i get this built and continue with the tutorial?
To comply with the newer versions of Gradle, change 'runProguard' to 'minifyEnabled'
in my case, i am using sinch 3.11.1.
it is aar file.
so you need to import aar file.
after that you can use sinch on your project.
to import aar file you can follow this video (it is not mine):
https://www.youtube.com/watch?v=J-GbMTa1fX0
hope it helps.
Today I have updated my Android Studio and I keep getting this error no matter what I do. I imported a project from github everything was running smoothly until I updated now I keep getting this error:
Error:(31, 0) Gradle DSL method not found: 'jniDebugBuild()'
Possible causes:The project 'my_application' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
Can anyone help out?
The name of this property has changed in v0.14.0 and later of the Android Gradle plugin, so build files created for earlier versions need to be updated. Look through all the build.gradle files in the project, and when you see jniDebugBuild, change it to jniDebuggable.
You may run into other things that need to be renamed; the list of remappings is in the release notes at http://tools.android.com/tech-docs/new-build-system.
after modifying my gradle build file like written in the docu I get the following error for all of my tasks:
Could not determine the dependencies of task ':android:testDebug'.
it is a subproject called android so might be just testDebug for others
using gradle-android-test-plugin:0.9.+
anybody knows what could be the problem?
after using gradle 1.6 instead of 1.7 it is working
A pull request was made on the plugin that essentially handles Gradle 1.7/1.8. The owner hasn't pushed it to the maven repo, so you can't use the version on the maven repo just yet.
I checked out the source code from github and added it as a manual dependency in my libraries with gradle. That should get you going.