Cannot resolve symbol 'RoadManager' - android

I get an error like this. What should I do? do i have to do? do i have to add something in my dependencies?
this my code
//, MapboxMap.OnMapClickListener, PermissionsListener, View.OnClickListener {
private MapView mapView;
private Button button;
private MapboxMap mapboxMap;
private PermissionsManager permissionsManager;
private LocationComponent locationComponent;
// variables for calculating and drawing a route
private DirectionsRoute currentRoute;
private static final String TAG = "DirectionsActivity";
private NavigationMapRoute navigationMapRoute;
private RoadManager roadManager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this is my dependencies
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'
//implementation 'com.firebaseui:firebase-ui-auth:1.2.0'
implementation 'com.squareup.picasso:picasso:2.71828' //2.5.2
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'//vcoba kalo error ini diapus
implementation 'com.google.android.gms:play-services-maps:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'org.osmdroid:osmdroid-android:5.6#aar'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.1'
implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1') {
exclude group: 'group_name', module: 'module_name'
}
}
what should I do to solve this problem?

RoadManager is part of OSMBonusPack.
First of all, you should follow OSMBonusPack HowToInstall guide.
And then follow OSMBonusPack tutorial.

Related

Jetpack Compose – Which dependency do I need to use to be able to use state delegates?

I have a compile-time error with the samples provided in the code-labs.
This is the ViewModel
class VM : ViewModel() {
val isVisible = MutableStateFlow(true).asStateFlow()
}
This is what I'd like to write:
#Composable
fun Whatever(vm: VM = viewModel()) {
val isVisible by vm.isVisible.collectAsState(true)
// Use is visible here
}
But it yields to the following error:
Type 'State<TypeVariable(R)>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Which is really strange because I can use it like so:
#Composable
fun Whatever(vm: VM = viewModel()) {
val isVisible = vm.isVisible.collectAsState(true)
if(isVisible.value) { … }
}
What dependency do I need to bring in to make the delegate work?
Here are my dependencies: and compose_version = 1.0.0-beta01
dependencies {
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation "androidx.activity:activity-compose:1.3.0-alpha03"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
// Kotlin coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.activity:activity-ktx:1.2.0'
implementation 'androidx.core:core-ktx:1.5.0-beta02'
implementation "androidx.activity:activity-compose:1.3.0-alpha03"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha02"
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation "androidx.compose.ui:ui-test:$compose_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
}
As described in the doc, try to add the following imports:
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState

Required Transition found: MaterialContainerTransform?

In my activity, I'm trying to use MaterialContainerTransform but it shows an error that
Required Transition found: MaterialContainerTransform
override fun onCreate(savedInstanceState: Bundle?) {
window.requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS)
setEnterSharedElementCallback(MaterialContainerTransformSharedElementCallback())
//this is giving error
window.sharedElementEnterTransition = MaterialContainerTransform().apply {
addTarget(android.R.id.content)
duration = 300L
}
window.sharedElementReturnTransition = MaterialContainerTransform().apply {
addTarget(android.R.id.content)
duration = 250L
}
My dependencies
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//material
implementation 'com.google.android.material:material:1.3.0-alpha02'
def coroutines_version = "1.3.8"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
}
There are two types of MaterialContainerTransform the com.google.android.material.transition.MaterialContainerTransform that uses AndroidX Transition and includes bug fixes that apply to all API levels and the com.google.android.material.transition.platform.MaterialContainerTransform class that is built on the framework Transition class.
Only the framework Transition version can be used for window transitions, so you should make sure you're importing the right version of MaterialContainerTransform:
import com.google.android.material.transition.platform.MaterialContainerTransform

error: cannot access zzbgl. class file for com.google.android.gms.internal.zzbgl not found

I want to show location of places in my app.
I get compile error of cannot access zzbgl
This is my gradle file :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.code.gson:gson:2.8.1'
//noinspection UseOfBundledGooglePlayServices
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.whiteelephant:monthandyearpicker:1.3.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.tarun0.zxing-standalone:zxing-standalone:1.0.0'
implementation 'com.edwardvanraak:MaterialBarcodeScanner:0.0.6-ALPHA'
implementation "ru.tinkoff.scrollingpagerindicator:scrollingpagerindicator:1.0.6"
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.crashlytics.sdk.android:crashlytics:2.10.1#aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
it shows compile error
error: cannot access zzbgl
class file for com.google.android.gms.internal.zzbgl not found
In my activity
#Override
public void onLocationChanged(Location location) {
this.location = location;
this.googleMap.animateCamera( CameraUpdateFactory.newLatLngZoom( new LatLng( location.getLatitude(), location.getLongitude() ), 18 ) );
this.googleMap.addMarker( new MarkerOptions().position( new LatLng( location.getLatitude(), location.getLongitude() ) ).title( "You are Hear" ) );
Marker myMarker = googleMap.addMarker( new MarkerOptions().position( new LatLng( 0.0, 0.0 ) ) );
myMarker.remove();
latitude = location.getLatitude();
longitude = location.getLongitude();
Log.d( "latitude", String.valueOf( latitude ) );
Log.d( "longitude", String.valueOf( longitude ) );
}
It show error on this line :
this.googleMap.addMarker( new MarkerOptions().position( new LatLng( location.getLatitude(), location.getLongitude() ) ).title( "You are Hear" ) );
Please help me.
How to solve this error.
From the docs:
Note: Don't use the combined play-services target. It brings in dozens of libraries, bloating your application. Instead, specify only the specific Google Play services APIs your app uses.
Therefore, remove the following dependency:
implementation 'com.google.android.gms:play-services:12.0.1'
And add the following:
implementation 'com.google.android.gms:play-services-maps:16.1.0'
Upgrading to the following fixed it for me: implementation 'com.google.android.gms:play-services-location:18.0.0'

My application crashes after google calendar implementation in FCM messaging

I am creating the android app for booking and also I need FCM messaging in the android app.When i implement FCM messaging than it is working well but after i implement the Google calendar in app than the app is crashing when i am sending message on FCM on that line:
java.lang.NoSuchMethodError: No static method
createRootContext(II)Lcom/fasterxml/jackson/core/json/JsonReadContext;
in class Lcom/fasterxml/jackson/core/json/JsonReadContext; or its
super classes (declaration of 'com.fasterxml.jackson.core.json.JsonReadContext' appears in /data/app/com.mmf.loggedinapp-2/split_lib_dependencies_apk.apk:classes102.dex)
This is my FCM Code :
fireBaseReference.push().setValue(map);
This is my FCM code which create crashing when i am sending message on FCM
usering this method reference1.push().setValue(map);
PrefManager prefManager = new PrefManager(getApplicationContext());
Map<String, String> map = new HashMap<String, String>();
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String strDate = sdf.format(c.getTime());
map.put("sender_id", prefManager.getLoggedInId());
map.put("message", messageText);
map.put("time", timeString);
map.put("receiver_id", contactid);
map.put("date", strDate);
map.put("type", "mobile");
map.put("messageStatus", "0");
map.put("status", "1");
if (docUri == null) {
map.put("doc_url", "");
map.put("docFileName", "");
} else {
map.put("doc_url", docUri.toString());
map.put("docFileName", docFileName);
}
if (imageUri == null) {
map.put("imageUri", "");
map.put("imageName", "");
} else {
map.put("imageUri", imageUri.toString());
map.put("imageName", imageName);
}
reference1.push().setValue(map);
This is my build.gradle :-
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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.android.support:design:27.1.1'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation'
com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.8.2'
implementation 'net.gotev:uploadservice:2.1'
implementation 'com.github.ome450901:SimpleRatingBar:1.3.2'
implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.github.travijuu:numberpicker:1.0.7'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.andanhm.quantitypicker:quantitypicker:1.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.sundeepk:compact-calendar-view:2.0.2.3'
implementation 'com.hbb20:ccp:2.0.8'
implementation 'com.github.barteksc:android-pdf-viewer:2.3.0'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'com.github.bumptech.glide:glide:4.3.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.devlomi.record-view:record-view:2.0.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.stripe:stripe-android:7.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.0'
implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
implementation 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.twilio:voice-android:2.0.7'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.koushikdutta.ion:ion:2.1.8'
implementation 'com.cocosw:bottomsheet:1.3.1'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'net.the4thdimension:audio-wife:1.0.3'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-calendar:v3-rev331-
1.24.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

GeoFire SetLocation Not Working

I am trying to save a location to geofire but not getting any response from console and in logs.
I have added the dependency in gradle files and created my database reference like this:
DatabaseReference pickupRef = FirebaseDatabase.getInstance().getReference(AppConstants.PICK_UP_REF);
pickupRef.keepSynced(true);
and the string AppConstants.PICK_UP_REF equals PickUpRef. In my activity, I have done this:
Log.d(TAG, "UID in PUR:\t" + uid);
GeoFire mGeoFire = new GeoFire(pickupRef.child(uid));
if (mLastLocation != null) {
mGeoFire.setLocation(uid, new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()), new GeoFire.CompletionListener() {
#Override
public void onComplete(String key, DatabaseError error) {
if (error != null){
Log.d(TAG, "Write complete");
} else {
Log.d(TAG, "Write Failed:\t" + error.getMessage());
}
}
});
The oncompletionlistener never gets fired and nothing is updated in my database. Anyone else faced this problem or have I misconfigured it?
Here's my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.jjoey.transportr"
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'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:12.0.1'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-places:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.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.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Change your dependencies like below in app grandle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
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'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.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.android.support:cardview-v7:27.1.1'
}
And change in Project grandle:
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'

Categories

Resources