Null Value In Entry: Stream Output Folder Is Null - java

I am working on Android Application using the Fire base Database. All the data stored perfectly on the Fire base.
The Problem comes when I make some changes and close the Application by Forcing android Studio to be Shut Down.
Now When I open Android to built Project It Gives Error of Stream output Folder as Null.
I have searched on Stack Overflow and find an answer with my Error Resemblance but I didn't understand the Answer completely.
Answer Searched
Here is my App Gradle Code
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.usmanali.medicineinvent"
minSdkVersion 16
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'
}
}
}
The dependancies in App Gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
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'
}
here is build. Gradle File
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
classpath 'com.google.gms:google-services:3.1.0'
}
}

This problem is just Resolved by Deleting the .Gradle File in the Project Folder.
After .gradle File Deletion;
Built and Clean the Project.

Related

Build Errors in Android Studio Gradle: It works fine when I remove the google dependency

So I am assuming I have differing versions of dependencies causing this issue but i cant seem to resolve it.
When I add the dependency: implementation 'com.google.android.gms:play-services-vision:18.0.0' Then I get an error Syncing my build gradle.
When I change the version to implementation 'com.google.android.gms:play-services-vision:15.0.0' Then It Syncs fine but my app keeps crashing as soon as I open it.
Please can someone help me sync my versions so my app doesnt crash.
I changed the version from 18.0.0 to 15.0.0.
My gradle:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.ecommerce"
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'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.rey5137:material:1.2.5'
implementation 'com.android.support:cardview-v7:+'
implementation 'com.android.support:recyclerview-v7:+'
implementation 'io.paperdb:paperdb:2.6'
implementation 'com.android.support:design:28.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.sup`enter code here`port.test.espresso:espresso-core:3.0.2'
}
After some research I actually found out that Google stopped updating com.google.android.gms:play-services after 12.0.1. I changed the versions as well as my Firebase versions. Everthing Synced with no errors and seems to be running fine now.
first go to file and sync project with gradle file.. if it repeat itself, then go to file and invalidate caches/Restart it has work for me alot of time and also try and replace minSdkVersion 15 to minSdkVersion 21 and also with the look of it your firebase dependence are old check out https://firebase.google.com/docs/android/setup or google firebase dependencies
also make sure you add allprojects
{
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
to your build.gradle

illegal forward reference in android studio project

It's an old Eclipse project now being migrated to Android studio. I'm getting one error: illegal forward reference error in one particular class. It actually not showing any red error indicator line at the error line suggested by Android Studio IDE. The weird thing is I tried to comment out the method in which is showing illegal forward reference error but even after commenting the Android studio points me to the same line number where it was showed as error previously.
I don't know whether it is Java compiler error or Android Studio IDE error.
app/build.gradle:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.karogevideos"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
useLibrary 'org.apache.http.legacy'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
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'
implementation 'biz.source_code:base64coder:2010-12-19'
implementation files('libs/libGoogleAnalyticsServices.jar')
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'commons-httpclient:commons-httpclient:3.1'
implementation 'commons-io:commons-io:2.6'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation files('libs/bugsense-trace-3.0.6.jar')
//implementation files('libs/jid3lib-0.5.1.jar')
implementation 'org.apache.httpcomponents:httpmime:4.5.2'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
implementation group: 'com.nineoldandroids', name: 'library', version: '2.4.0'
implementation group: 'commons-net', name: 'commons-net', version: '3.5'
}
project/build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.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" }
}
}
Let me know if you need any more details in comments, Thanks in advance.
Put this jid3lib-0.5.1.jar jar file in your lib folder. Gradle doesn't find this file in your lib folder Location.

Manifest Merger Failed when importing my aar library into project

Iam new in developing android library.Recently there was a requirement to integrate some part of my app to other client app. For that, I have uploaded an aar format library through sonatype to maven repository.
But the problem arises when i integrate this library to other app.I have encountered some error like-:
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/android/volley/Response$ErrorListener;
and many more like that.
The problem which I think so far is coming from the multiple dependencies defined in both app and library.
Is there anything which iam doing wrong in my library and how can we remove the duplicate library from the app.
I have tried many options like "multidex enable true and preDexLibraries = false" option but none of that attribute work.
Any help is appreciated.
My library app level gradle is-:
apply plugin: 'com.android.library'
apply from: 'maven-push.gradle'
android {
compileSdkVersion 26
useLibrary 'org.apache.http.legacy'
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
consumerProguardFiles 'proguard-rules.pro'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
useProguard true
//consumerProguardFiles 'proguard-rules.pro'
buildConfigField "String", "BASEURL", PROD_SERVICE_URL
buildConfigField "String", "MERCHANT_ID", MERCHANT_ID
buildConfigField "String", "ACCESS_CODE", ACCESS_CODE
}
debug {
buildConfigField "String", "BASEURL", STAGING_SERVICE_URL
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.jpardogo.googleprogressbar:library:1.2.0'
implementation 'com.karumi:dexter:4.2.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'org.jsoup:jsoup:1.7.3'
implementation 'com.mcxiaoke.volley:library:1.0.17'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
//implementation 'com.google.android.gms:play-services-base:15.0.1'
//compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:multidex:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
task deleteJar(type: Delete) {
delete 'libs/jars/logmanagementlib.jar'
}
task createJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('libs/jars/')
include('classes.jar')
rename('classes.jar', 'logmanagementlib.jar')
}
createJar.dependsOn(deleteJar, build)
Thanks
In your library AndroidManifest.xml remove everything from Application tag:
<application/>
when you import the library in application, all dependencies you import in the library will be imported in the application so remove the any library you imported in library before in application gradle file
if there is a problem with merging the AndroidManifest.xml you can see the error in the Merged Manifest tab in the bottom left corner

cannot resolve symbol 'chromium'

I am trying to use Trusted Web Activity, following this guide : https://developers.google.com/web/updates/2017/10/using-twa
I did follow all the steps, but there are several words Android Studio cannot resolve by itself and I do not find any solution. The main problem seems to be org.chromium .
In bold the words it can't resolve :
in TwaSessionHelper.java :
import org.chromium.customtabsclient.shared.ServiceConnection;
import org.chromium.customtabsclient.shared.ServiceConnectionCallback;
...
public class TwaSessionHelper implements ServiceConnectionCallback
{
...
mConnection = new ServiceConnection(this);
in TwaLauncherActivity.java :
setContentView(R.layout.activity_twa_launcher);
and in the few lines of code :
TwaSessionHelper.TwaSessionCallback twaSessionCallback = mTwaSessionCallback.get();
What am I missing ?
Here is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "didi.a8bitpocketwrestlers"
minSdkVersion 17
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.+'
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.android.support:customtabs:28.+'
}
Android Studio cannot resolve ServiceConnectionCallback class because a com.android.support:customtabs library does not contain/provide it. This class exists only in this GitHub repository and no any maven repository. So you not able to add a dependency on it in your build.gradle file, you have to download it and add it in your project manually.
From this GitHub repository download only shared directory, add it in your project as a module.
In your application build.gradle file add a dependency on the shared module.
compile project(':shared')

Getting an error "could not find method implementation()" in Android Studio

I'm getting this ERROR message.
Could not find method implementation() for arguments [project ':app']
on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Here's my project level's gradle file :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "https://maven.google.com" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://maven.google.com" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
dependencies {
implementation project(':app')
}
Here's my app's gradle file :
apply plugin: 'com.android.application'
apply plugin: 'java-library'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.therationalbloke.myapplication"
minSdkVersion 15
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-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation project(':app')
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'
}
NOTE : I'm already aware of the following.
The "compile" has been replaced by "implementation" in Gradle 3.0 or
higher.
Yes, I'm using Android Studio's latest version and according to Rob, I should prefer the old one. But the thing is that I was haunted
by a lot of technical issues in that version (a lot of them included
stuff which is now outdated).
I've read almost every solution to this problem on Stack Overflow, Github. All of them are either asking to use implementation() instead
of compile (which I'm already using), or they're asking to check if
the Gradle version is 3.0+.
I've tried changing all the "implementation" to "compile" on suggestion of one user on Stackoverflow.
I've tried importing a lot of libraries as suggested by a lot of people in different communities.
Some info about my Android Studio
Android Studio - 3.1.3
Android Plugin Version - 3.1.3
Gradle Version - 4.4
Screenshot of the situation
I've never seen something like implementation project(':app') on a gradle file.
Here you have an example of a working gradle file, try deleting implementation project(':app') and resync.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.amvt_notebook4.codigoqrtest"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies
{
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
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'
implementation 'com.google.android.gms:play-services:10.0.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation files('build/libs/mail.jar')
implementation files('build/libs/additionnal.jar')
implementation files('build/libs/activation.jar')
implementation files('build/libs/jtds-1.3.1.jar')
implementation 'com.android.support:multidex:1.0.3'
}

Categories

Resources