setOnGroupExpandListener is not resolved, android - java

I followed this link and the answer with most results gives me that the method, setOnGroupExpandListener cannot be resolved. I'm new to android and currently doing stuff basically by checking out how others have done it and try to learn from them.
ExpendableListAdapter listAdapter;
ExpandableListView expListView;
private int lastExpandedPosition = -1;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
#Override
public void onGroupExpand(int groupPosition) {
if (lastExpandedPosition != -1
&& groupPosition != lastExpandedPosition) {
expListView.collapseGroup(lastExpandedPosition);
}
lastExpandedPosition = groupPosition;
}
});
This is in my MainActivity.java, setOnGroupExpandListener is underlined and "not resolved".
These are the imported classes:
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ExpandableListView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
This is the content of my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.kevin.ha1kattai"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
This is my project file

Android ExpandableListView Support Min SDK:10. Please change YourminSdkVersion .
android:minSdkVersion
An integer designating the minimum API Level required for the application to run.
Please set minSdkVersion as 13 or 17 for better approach
Edited
defaultConfig {
applicationId "com.example.kevin.ha1kattai"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}

Related

import android.support.v7.app.appcompatactivity error

I'm taking a Udemy course and trying to make an Instagram clone in Android Studio. However, the course is a bit outdated and its causing problems with the main activity. The project does not recognize AppCompatActivity and won't even import it. It's my first time implementing a parse server on a project so I'm a bit confused. I managed to code the build.gradle in a way to get the 2nd activity to work but I cannot get the main activity to work. I have looked for solutions everywhere and cannot find any. This is also my first time asking a question here so sorry if I messed anything up. Here's my code:
MainActivity
package com.parse.starter;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Switch;
import com.parse.LogInCallback;
import com.parse.Parse;
import com.parse.ParseAnalytics;
import com.parse.ParseAnonymousUtils;
import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.SaveCallback;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
}
StarterApplication:
package com.parse.starter;
import android.app.Application;
import android.util.Log;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.SaveCallback;
public class StarterApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("")
.clientKey("")
.server("")
.build()
);
ParseObject object = new ParseObject("ExampleObject");
object.put("myNumber", "123");
object.put("myString", "rob");
object.saveInBackground(new SaveCallback () {
#Override
public void done(ParseException ex) {
if (ex == null) {
Log.i("Parse Result", "Successful!");
} else {
Log.i("Parse Result", "Failed" + ex.toString());
}
}
});
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
}
build.gradle(Project):
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
ext {
compileSdkVersion = 22
buildToolsVersion = "23.0.1"
minSdkVersion = 9
targetSdkVersion = 23
}
build.gradle(Module):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.parse.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:multidex:1.0.0'
}
You're using outdated/deprecated code.
Don't copy the whole code from the sample or tutorials because they might be using an older version of the android studio hence outdated code.
I suggest making a fresh project and using androidx this time
For your problem try importing androidx.appcompat.app.AppCompatActivity
and add this dependency androidx.appcompat:appcompat:1.4.1

Why I am getting such a message:java.lang.NoSuchMethodError: No virtual method fetchProvidersForEmail(Ljava/lang/String;)

I am trying to create an Android program, and met an error of which I have no idea how to solve.
My app crashes after I put in the email. I suspect that the problem is related with firebase. I have tried different ways of solving of this problem, such as changing the versions of firebase implementations, but without any success.
Here is my code
MainActivity.java
package com.chat.mychatapp;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.database.FirebaseListAdapter;
import com.github.library.bubbleview.BubbleTextView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.FirebaseDatabase;
import android.text.format.DateFormat;
import java.util.Objects;
public class MainActivity extends AppCompatActivity {
public static int SIGN_IN_CODE = 1;
private RelativeLayout activity_main;
private FirebaseListAdapter<Message> adapter;
private FloatingActionButton sendBtn;
#Override
protected void onActivityResult(int requestCode, int resultCode, #Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == SIGN_IN_CODE){
if(resultCode == RESULT_OK){
Snackbar.make(activity_main, "You are authorized", Snackbar.LENGTH_LONG).show();
displayAllMessages();
}else{
Snackbar.make(activity_main, "You are NOT authorized", Snackbar.LENGTH_LONG).show();
finish();
}
}
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
activity_main = findViewById(R.id.activity_main);
sendBtn = findViewById(R.id.sendBtn);
sendBtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
EditText textField = findViewById(R.id.messageField);
if(textField.getText().toString().equals(""))
return;
FirebaseDatabase.getInstance().getReference().push().setValue(
new Message(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getEmail(),
textField.getText().toString()
)
);
textField.setText("");
}
});
//User not autorized
if(FirebaseAuth.getInstance().getCurrentUser() == null){
startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder().build(), SIGN_IN_CODE);
}else{
Snackbar.make(activity_main, "You are authorized", Snackbar.LENGTH_LONG).show();
displayAllMessages();
}
}
private void displayAllMessages() {
ListView listOfMessages = findViewById(R.id.messageList);
adapter = new FirebaseListAdapter<Message>(this, Message.class, R.layout.list_item, FirebaseDatabase.getInstance().getReference()) {
#Override
protected void populateView(View v, Message model, int position) {
TextView m_user, m_time;
BubbleTextView m_text;
m_user = v.findViewById(R.id.messageUser);
m_time = v.findViewById(R.id.messageTime);
m_text = v.findViewById(R.id.messageText);
m_user.setText(model.getUserName());
m_text.setText(model.getMessage());
m_time.setText(DateFormat.format("dd-mm-yyyy HH:mm:ss",model.getTime()));
}
};
listOfMessages.setAdapter(adapter);
}
}
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.chat.mychatapp"
minSdkVersion 19
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'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.firebaseui:firebase-ui:0.6.2'
implementation 'com.github.lguipeng:BubbleView:1.0.1'
//implementation 'com.google.firebase:firebase-firestore:21.3.1'
}
apply plugin: 'com.google.gms.google-services'
Error
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.chat.mychatapp, PID: 18455
java.lang.NoSuchMethodError: No virtual method fetchProvidersForEmail(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/auth/FirebaseAuth; or its super classes (declaration of 'com.google.firebase.auth.FirebaseAuth' appears in /data/app/com.chat.mychatapp-s_3u6mmiv0A6KE9ijznfqQ==/base.apk)
at com.firebase.ui.auth.ui.AcquireEmailHelper.checkAccountExists(AcquireEmailHelper.java:55)
at com.firebase.ui.auth.ui.email.SignInNoPasswordActivity.onClick(SignInNoPasswordActivity.java:73)
at android.view.View.performClick(View.java:7339)
at android.widget.TextView.performClick(TextView.java:14222)
at android.view.View.performClickInternal(View.java:7305)
at android.view.View.access$3200(View.java:846)
at android.view.View$PerformClick.run(View.java:27787)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7078)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Update the following dependency:
implementation 'com.firebaseui:firebase-ui:0.6.2'
into this:
implementation 'com.firebaseui:firebase-ui:6.2.0'
https://github.com/firebase/FirebaseUI-Android
From the docs:
Removed the deprecated fetchProvidersForEmail(String) method from the FirebaseAuth class, as well as the associated ProviderQueryResult class. Use fetchSignInMethodsForEmail(String) instead.
Therefore update the firebaseUI and you can use fetchSignInMethodsForEmail(String) instead.

Android Error Program type already present

I am struggling with an error since two day. Hope someone can help me.
I am using AndroidStudio 3.3.1 on MacOS. When I build the project, i receiver the following error message:
Error: Program type already present: com.loopj.android.http.BaseJsonHttpResponseHandler
My build.gradle looks like:
apply plugin: 'com.android.application'
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "lalalalalalala"
minSdkVersion 19
targetSdkVersion 28
versionCode 7
versionName "1.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:design:28.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
}
apply plugin: 'com.google.gms.google-services'
as dependencies I have
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.2.0'
}
in gradle.properties is
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
and in in gradle-wrapper.properties I have
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
I start to believe is a bug of AndroidStudio 3.3.1.
Does anyone see a problem in my code ?
Any help is highly appreciated :)
edit:
package lalalalalala;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.webkit.WebViewClient;
import com.loopj.android.http.*;
import im.delight.android.webview.AdvancedWebView;
public class MainActivity extends Activity implements AdvancedWebView.Listener {
private AdvancedWebView WebView;
protected static boolean isActivityRunning;
public static boolean checkIfAppIsRunnung()
{
return isActivityRunning;
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Cookies
AsyncHttpClient myClient = new AsyncHttpClient();
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
myClient.setCookieStore(myCookieStore);
setContentView(R.layout.activity_main);
WebView = (AdvancedWebView) findViewById(R.id.webWiew);
WebView.setListener(this, this);
WebView.setThirdPartyCookiesEnabled(false);
Intent mIntent = new Intent(this, MyFirebaseMessagingService.class);
startService(mIntent);
WebView.loadUrl("lalalalalalala");
WebView.setWebViewClient(new WebViewClient());
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
WebView.onActivityResult(requestCode, resultCode, intent);
// ...
}
#Override
public void onPageStarted(String url, Bitmap favicon) { }
#Override
public void onPageFinished(String url) { }
#Override
public void onDownloadRequested(String url, String suggestedFilename, String mimeType, long contentLength, String contentDisposition, String userAgent) { }
#Override
public void onExternalPageRequest(String url) { }
}

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException:

I got Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
my mainActivity.java:
package si.mojkuzek.app.graphdemo2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
public class MainActivity extends AppCompatActivity {
LineGraphSeries<DataPoint> series;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[]{
new DataPoint(0, 1),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(4, 6)
});
}
}
build.grandle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "si.mojkuzek.app.graphdemo2"
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'
}
dependencies {
compile files ('libs/GraphView-4.2.1.jar')
}
How to fix this error?
I tried multiDexEnabled true
but it does not work
Also clean and rebuild

Android firebase integration with Google Maps

I am trying to integrate my firebase database with Google Maps but I am having issues. Here is my code:
package com.test.googlemap;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import com.firebase.client.DataSnapshot;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;
import com.firebase.client.ValueEventListener;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.UiSettings;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
private static GoogleMap mMap;
private GoogleApiClient mGoogleApiClient;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Firebase.setAndroidContext(this);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
/*if (mGoogleApiClient == null) {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}*/
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
#Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
UiSettings UiSettings = googleMap.getUiSettings();
UiSettings.setZoomControlsEnabled(true);
LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = service.getBestProvider(criteria, true);
//Location myLocation = service.getLastKnownLocation(provider);
mMap.setMyLocationEnabled(true);
//double latitude = myLocation.getLatitude();
//double longitude = myLocation.getLongitude();
//LatLng startingPosition = new LatLng(latitude, longitude);
LatLng sydney = new LatLng(-34, 151);
createMarker();
//mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
private void createMarker() {
Firebase ref = new Firebase("https://shining-fire-3472.firebaseio.com/locations");
//Query queryRef = ref.orderByChild("latitude");
ref.addListenerForSingleValueEvent(new ValueEventListener() {
#Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot userSnapshot : dataSnapshot.getChildren()) {
markerLocation marker = userSnapshot.getValue(markerLocation.class);
Double lat = Double.parseDouble(marker.getLatitude());
Double log = Double.parseDouble(marker.getLongtitude());
LatLng latLng = new LatLng(lat, log);
mMap.addMarker(new MarkerOptions().position(latLng));
}
}
#Override
public void onCancelled(FirebaseError firebaseError) {
}
});
}
}
Here is the appbuild gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.test.googlemap"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
}
dexOptions {
preDexLibraries = false
incremental = true;
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile files('libs/firebase-client-android-2.5.2.jar')
}
I am trying to retrieve marker location objects in order to create custom markers that will show up the Map. The project will sync but whenever I try and build an APK I get this error:
Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 1
I've tried all of the fixes from other similar questions but none have worked for me.
It happen because of heap size
I have face same issue but issue is resolved .
Please check below build.gradle/app file and do some changes in it.
Firebase version and map version should be .
Please check Code
add this two things in your gradle
multiDexEnabled true
**dexOptions {
javaMaxHeapSize "4g"
}*
*
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.jmtechnologies.askuscash"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
// Spinner
compile 'com.jaredrummler:material-spinner:1.1.0'
//Firebase
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
Based on this page, they solved this kind of issue by using following this steps.
Download & unzip the SDK. This should create a folder named Parse-1.xx.x (Parse-1.11.0 in my case)
Move the entire folder to /apps/libs (make sure you deleted the previous Parse-*.jar file)
Build > Rebuild project
If you have problem with bolts file you can resolve it by following this steps.
Go to: https://github.com/ParsePlatform/Parse-SDK-Android
Download the jar file
Store the downloaded jar file in the src/main/libs folder
Then add the dependency in the build.gradle(module:app) file " compile 'com.parse:parse-android:1.11.0' " -> or whatever is the version number for the jar file.
Sync the gradle file.
Also try to check the solution for this SO question.

Categories

Resources