Mindinventory / vanilla-place-picker

Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android
https://www.mindinventory.com/android-application-development.php
MIT License
120 stars 34 forks source link

Crash when using with java #19

Closed DennyWeinberg closed 4 years ago

DennyWeinberg commented 5 years ago

Important part:

java.lang.RuntimeException: Unable to start activity 
Caused by: android.view.InflateException: Binary XML file line #31: Binary XML file line #43: Error inflating class TextView
     Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class TextView
     Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1}
        at android.content.res.TypedArray.getColorStateList(TypedArray.java:546)
        at android.widget.TextView.readTextAppearance(TextView.java:3873)
2019-05-29 13:21:53.067 29436-29436/com.levionsoftware.photos E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.levionsoftware.photos, PID: 29436
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.levionsoftware.photos/com.vanillaplacepicker.presentation.map.VanillaMapActivity}: android.view.InflateException: Binary XML file line #31: Binary XML file line #43: Error inflating class TextView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3086)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:6981)
        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:1445)
     Caused by: android.view.InflateException: Binary XML file line #31: Binary XML file line #43: Error inflating class TextView
     Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class TextView
     Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1}
        at android.content.res.TypedArray.getColorStateList(TypedArray.java:546)
        at android.widget.TextView.readTextAppearance(TextView.java:3873)
        at android.widget.TextView.<init>(TextView.java:1208)
        at android.widget.TextView.<init>(TextView.java:1102)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:98)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:94)
        at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
        at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
        at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1378)
        at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1428)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:995)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:859)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:532)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
        at com.vanillaplacepicker.presentation.common.VanillaBaseActivity.onCreate(VanillaBaseActivity.kt:17)
        at com.vanillaplacepicker.presentation.common.VanillaBaseViewModelActivity.onCreate(VanillaBaseViewModelActivity.kt:13)
        at android.app.Activity.performCreate(Activity.java:7326)
        at android.app.Activity.performCreate(Activity.java:7317)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3066)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
2019-05-29 13:21:53.067 29436-29436/com.levionsoftware.photos E/AndroidRuntime:     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:6981)
        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:1445)

My call:

        Intent intent = new VanillaPlacePicker.Builder(activity)
                .withLocation(23.057582, 72.534458)
                .enableMap() // Enable to select place from map
                .build();

        activity.startActivityForResult(intent, REQUEST_PLACE_PICKER);

Gradle: implementation 'com.github.Mindinventory:VanillaPlacePicker:0.0.6'

I had to do that to eluminate that duplicate error:

    configurations {
        all {
            exclude group: 'com.google.guava', module: 'listenablefuture'
        }
    }

(Source: https://stackoverflow.com/questions/54575037/duplicate-jar-listenablefuture-class-while-migrating-to-new-place-sdk-google)

akashmi commented 4 years ago

Issue has been resolved in version 0.1.1.