I have imported the module from my previous android project but when i try to add it as a library it is not showing and it is not showing as a module I am able to see the module only in the project mode my gradle is also working fine
apply plugin: 'com.android.application'
is also i am using but dont know why when i try to add module from project structure it show no module what will i do i followed many question and non is solving my problem i have every thing update and of latest version
my gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.musicplayer.music.audioplayer"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
project.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Related
I have installed opencv on android studio, and run a canny edge detection successfully on my phone (redmi note 8 pro). but when i want to run yolo3 for object detection using this link, when i push the button to perform object detection, the app is closed, and show a long error which here is its beggining:
here's app build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.m_series_v2_cv_nn"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation project(path: ':openCVLibrary343')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
any help is appreciated. let me know if any more information is required.
I changed the opencv version from 3.4.3 to 3.4.5, and it is working well
I am new to android development and I 'm building android app. I'm using gradle and I got the error message A problem occurred configuring project ':app'.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
//classpath 'ext.supportLibraryVersion = 27.1.1'
classpath 'com.android.support:support-v4:27.1.1'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The above code is the project level of build.gradle file.
The following code is the app level of build.gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "mm.com.fairway.firebaseauth"
minSdkVersion 22
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
I searched the solution to fix this error and I don't find the solution yet. Any ideas for this error and Thank you.
classpath 'com.android.support:support-v4:27.1.1
The above line is in the wrong Gradle file. Also change it from classpath to implementation.
So something like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
//classpath 'ext.supportLibraryVersion = 27.1.1'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "mm.com.fairway.firebaseauth"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
Do note, I updated the project to 28 and other dependencies were also upgraded. I did this as I don't have SDK 27 installed anymore.
Upgrading your Gradle build tools to 3.2 or higher will solve this problem.
For example:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
//classpath 'ext.supportLibraryVersion = 27.1.1'
classpath 'com.android.support:support-v4:27.1.1'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
This solved it for me and seems to have solved it for this other person as well:
I have a gradle sync error JAVA_LETTER_OR_DIGIT when trying to add Firebase to my android project
while dragging and dropping the grid layout into the design of my app,I get the following message:-
This operation requires the library com.android.support:gridlayout-v7:+.
Problem: Inconsistencies in the existing project dependencies found.
Version incompatibility between:
- com.android.support:appcompat-v7:28.0.0
and:
- com.android.support:appcompat-v7:28.0.0
With the dependency:
- com.android.support:support-annotations:26.1.0
versus:
- com.android.support:support-annotations:28.0.0
The project may not compile after adding this library.
Would you like to add it anyway?
What should I do???Please help.
i have only 7 days of experience with android.
I am using android 3.4.1 for Windows 64-bit.
Below are the gradle dependencies:-
classpath 'com.android.tools.build:gradle:3.4.0'
The app gradle is:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.connect3"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
and this is the other one that has the project name on it:-
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried other SO solutions and with lower and same support lib version but everytime it's giving me this error:
Error:Failed to resolve: com.android.support:support-v13.27.0.0:
Open File
Heres the app.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "io.github.blackjack"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
compile 'com.android.support:support-v13.27.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Tried adding maven on
build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
// maven{ url 'https://maven.google.com'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Am I missing something?
You are using incorrect line:
compile 'com.android.support:support-v13.27.0.1'
it should be:
compile 'com.android.support:support-v13:27.0.1'
it should be : not . after support-v13
i am trying to connect my app with firebase-console.
i follow the instruction step by step.
but when i follow this step,
"The Google services plugin for Gradle contains the google-services.json file you just downloaded. Change your build.grade file to use this plugin."
project-level build.gradle:
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:3.1.0'
}
}
app-level build.gradle
...
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
then trying to sync, i got this error
Error(31,0) Plugin with id 'com.google.gms.google-play-services' not found
...
someone can help me fix this?
this is my code now.
project build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.kreuzell.myapplicationss"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-ads:11.4.2'
}
apply plugin: 'com.google.gms.google-play-services'
change this:
apply plugin: 'com.google.gms.google-play-services'
to this:
apply plugin: 'com.google.gms.google-services'
Simply use the tools option on android studio and select firebox from drop down and connect using the option.
It will automatically add the configurations files
[Tools 1