Giter Site home page Giter Site logo

wzieba / kmm-in-exsiting-project-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 115 KB

This repository is a template for libraries that are meant to be integrated into exsiting codebase.

Kotlin 48.28% Swift 51.72%
android ios kmm kmm-library kmp kotlin kotlin-multiplatform kotlin-multiplatform-mobile

kmm-in-exsiting-project-template's Introduction

kmm-in-exsiting-project-template's People

Contributors

dependabot[bot] avatar wzieba avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

shageldi-dev

kmm-in-exsiting-project-template's Issues

Android App immediately crashes on emulator and real device

Hi, I hope this is useful for you...
Really appreciate the repo!
I cloned your template and ran the test apps for Android and iOS. Running the androidApp from both Android Studio builds successfully, but the Android app immediately crashes on both an emulator and a real device (Tested this with Android 10 so far). This is the stacktrace:

2021-04-15 15:19:11.677 17111-17111/com.automattic.myapplication.androidApp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.automattic.myapplication.androidApp, PID: 17111
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.automattic.myapplication.androidApp/com.automattic.myapplication.androidApp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.automattic.myapplication.androidApp.MainActivity" on path: DexPathList[[zip file "/data/app/com.automattic.myapplication.androidApp-FaKZaENNyJLsbQh6wYYHfA==/base.apk"],nativeLibraryDirectories=[/data/app/com.automattic.myapplication.androidApp-FaKZaENNyJLsbQh6wYYHfA==/lib/x86, /system/lib, /system/product/lib]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.automattic.myapplication.androidApp.MainActivity" on path: DexPathList[[zip file "/data/app/com.automattic.myapplication.androidApp-FaKZaENNyJLsbQh6wYYHfA==/base.apk"],nativeLibraryDirectories=[/data/app/com.automattic.myapplication.androidApp-FaKZaENNyJLsbQh6wYYHfA==/lib/x86, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
        at android.app.Instrumentation.newActivity(Instrumentation.java:1243)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

Obviously, the MainActivity is registered correctly in the AndroidManifest, so I'm confused where this error comes from, since that is the typical source for this kind of problem. A freshly created KMM project runs without issues but I was unable to find the difference. Not super experienced with Multiplatform yet, so I'm hitting a wall here...Could you maybe investigate if there's an error in the template ( does it run properly for you?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.