Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App is crashing #5

Open
laxmimerit opened this issue Apr 1, 2018 · 13 comments
Open

App is crashing #5

laxmimerit opened this issue Apr 1, 2018 · 13 comments

Comments

@laxmimerit
Copy link

Hi,
I am trying to use this library but App keeps crashing. I had only included your library in the layout file. There is know extra code which might be wrong. Even I have tried your sample code but app keeps crasing with following error.

Error inflating class pl.hypeapp.materialtimelineview.MaterialTimelineView

@hypeapps
Copy link
Owner

hypeapps commented Apr 1, 2018

Hi,

it sounds not so cool. Can you provide me your configuration(sdk version, constraint layout version, android version) and full stack trace?

@laxmimerit
Copy link
Author

Here is app build.gradle

`apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.mbreath.timeline"
minSdkVersion 23
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'
implementation 'pl.hypeapp:materialtimelineview:1.0'
implementation 'com.android.support:cardview-v7:26.1.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'
}`

@laxmimerit
Copy link
Author

I am using build gradle version 3.0

@laxmimerit
Copy link
Author

Here is the code which I am testing with constraint layout in activity_main.xml

<pl.hypeapp.materialtimelineview.MaterialTimelineView
android:id="@+id/material_timeline_view"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@android:color/holo_orange_light"
app:timeline_top_radio_color="@android:color/white"
app:timeline_bottom_radio_color="@android:color/white"
app:timeline_line_color="@android:color/white"
app:timeline_type="item"
app:timeline_position="first"
app:timeline_margin_start="32dp"
app:timeline_radio_outline_radius="20"
app:timeline_radio_radius="12">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="HELLO WORLD"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"/>

</pl.hypeapp.materialtimelineview.MaterialTimelineView>

@hypeapps
Copy link
Owner

hypeapps commented Apr 1, 2018

Ok. Thank you. If you download sample app from Google play everything is all right? And what's your mobile device? I will try to reproduce error.

@laxmimerit
Copy link
Author

Thanks for quick response.
I am using Android Emulator Nexus 5 as well as Mi 4A but in both device, it keeps crashing.

@laxmimerit
Copy link
Author

Here is a full error log.
`
04-01 09:34:43.685 16248-16248/com.example.mbreath.timeline E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mbreath.timeline, PID: 16248
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mbreath.timeline/com.example.mbreath.timeline.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class pl.hypeapp.materialtimelineview.MaterialTimelineView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class pl.hypeapp.materialtimelineview.MaterialTimelineView
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class pl.hypeapp.materialtimelineview.MaterialTimelineView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.example.mbreath.timeline.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
at pl.hypeapp.materialtimelineview.MaterialTimelineView.(MaterialTimelineView.kt)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:377) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at com.example.mbreath.timeline.MainActivity.onCreate(MainActivity.java:11) 
at android.app.Activity.performCreate(Activity.java:6679) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
04-01 09:34:43.685 16248-16248/com.example.mbreath.timeline E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/com.example.mbreath.timeline-1/base.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.mbreath.timeline-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.mbreath.timeline-1/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 26 more

`

@laxmimerit
Copy link
Author

Hello, Did you reproduce this error?

@hypeapps
Copy link
Owner

hypeapps commented Apr 2, 2018

I will give you response tomorrow. Actually I'm on the easter holiday with family :)

@laxmimerit
Copy link
Author

Ok. Thanks 👍
Enjoy the holidays.

@hypeapps hypeapps closed this as completed Apr 3, 2018
@hypeapps hypeapps reopened this Apr 3, 2018
@hypeapps
Copy link
Owner

hypeapps commented Apr 3, 2018

So I updated:
gradle wrapper to 4.4-all
build gradle to 3.1.0
kotlin gradle plugin to 1.2.30
bulid tools version to 27.0.3
support libs to 27.1.0

And I have to change kotlin-stdlib-jre7 to kotlin-stdlib artifact. I think that was the problem. More info: android-library-module-developed-in-kotlin-exported-to-java-application-causing

On my AVD Nexus 5 API 26 (Oreo) everything works fine. Can you now pull the origin master and try to run sample? If it works I push changes to maven repository.

@ghost
Copy link

ghost commented Apr 5, 2018

I too am also receiving his error in the latest version of gradle

@hypeapps
Copy link
Owner

hypeapps commented Apr 6, 2018

@laxmimerit @Xenero

Can you guys change dependency to:
implementation 'pl.hypeapp:materialtimelineview:1.1'

And also add kotlin-stdlib if you write project in Java:
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.2.31'

If you do this everything should work. Let me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants