Giter Site home page Giter Site logo

Comments (7)

Archinamon avatar Archinamon commented on May 27, 2024

Hi!

Could you provide please more info:

  • what version of android gradle plugin do you use?
  • what version of aspectj plugin do you use?
  • maybe a minimal reproduceable project you can share?

from android-gradle-aspectj.

averyzhong avatar averyzhong commented on May 27, 2024

Hi!

gradle plugin & aspectJ plugin version:

classpath "com.android.tools.build:gradle:4.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.archinamon:android-gradle-aspectj:4.2.1'

android version:

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.foo.aop"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

from android-gradle-aspectj.

superafroman avatar superafroman commented on May 27, 2024

This is also happening for me. It seems to be linked to having multiple variants and using includeJars - possibly the jars are being included for each variant?

from android-gradle-aspectj.

superafroman avatar superafroman commented on May 27, 2024

Note, after a little more investigation the additional variants aren't the issue. I've opened a PR that includes a failing test showing the issue ☝️

I'm happy to fix this, but any pointers would be helpful - from what I can tell the processed classes are being included along with the original dependency when the multi dexing is being done?

from android-gradle-aspectj.

superafroman avatar superafroman commented on May 27, 2024

I have pinpointed the problem as the addition of copying the include jars that resolves #108 and updated my PR to revert this change and add a test for both this issue and 108.

(@Archinamon please review when you can)

from android-gradle-aspectj.

Archinamon avatar Archinamon commented on May 27, 2024

@superafroman
Hi! Sorry for being offline for so long. I've took a look at your code. It seems have to work, but I'll test in my production project first before commiting public packages.

Thank's for your contribution!

from android-gradle-aspectj.

jdvp avatar jdvp commented on May 27, 2024

@superafroman This change, which was released in the 4.3.0 version of the plugin today, seems to have re-introduced issue #108

AGP v4.1.0 and android-gradle-aspectj v3.4.0

This branch on my sample project is exhibiting the issue for reference:
https://github.com/jdvp/AndroidAspectExample/tree/feature/agp-4.1.0

Stacktrace if interested:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: me.jdvp.androidaspectexample.debug, PID: 5225
    java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/R$drawable;
        at androidx.appcompat.widget.AppCompatDrawableManager$1.<init>(AppCompatDrawableManager.java:63)
        at androidx.appcompat.widget.AppCompatDrawableManager.preload(AppCompatDrawableManager.java:57)
        at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:336)
        at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:286)
        at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:230)
        at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:554)
        at androidx.appcompat.app.AppCompatActivity.attachBaseContext(AppCompatActivity.java:107)
        at android.app.Activity.attach(Activity.java:7899)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3401)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        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:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.R$drawable" on path: DexPathList[[zip file "/data/app/~~oR4sHx3yVPaRSB1KduWpUQ==/me.jdvp.androidaspectexample.debug-I1VyhpPc3vfvewIIUTYhow==/base.apk"],nativeLibraryDirectories=[/data/app/~~oR4sHx3yVPaRSB1KduWpUQ==/me.jdvp.androidaspectexample.debug-I1VyhpPc3vfvewIIUTYhow==/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)

from android-gradle-aspectj.

Related Issues (20)

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.