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

Using Rigger in kotlin activities/fragments is throwing Runtime exception #24

Open
manikantagarikipati opened this issue Feb 6, 2018 · 10 comments

Comments

@manikantagarikipati
Copy link

java.lang.RuntimeException: Unable to start activity ComponentInfo{MyAppCompatActivity.class}: com.jkb.fragment.rigger.exception.RiggerException: UnKnown error MyAppCompatActivity@16f1f3 is not added into rigger. please check your config or contact author.

@JingYeoh
Copy link
Owner

JingYeoh commented Feb 7, 2018

@manikantagarikipati Do you turn off Instant run? this exception should be never throwed. please show me your code.

@manikantagarikipati
Copy link
Author

Yes I have turned it off!.

My Activity Annotation:

@Puppet(containerViewId = R.id.fl_content, bondContainerView = true)
class BasePCMPinActivity : BaseActivity() {//base activity is AppCompatActivity Instance

  //here is how i'm setting fragment
 Rigger.getRigger(this).startFragment(MyFragment.Companion.newInstance());

}

@Puppet
class MyFragment:BaseFragment{// this is v4 Fragment
}

Also I've added all the AOP Plugins and the dependencies.

@JingYeoh
Copy link
Owner

JingYeoh commented Feb 7, 2018

that's weird, have you tried to clean your project ? that could be useful. if not, please show me your gradle version.

@manikantagarikipati
Copy link
Author

manikantagarikipati commented Feb 7, 2018

Yeah felt the same, I've cleaned it couple of times/ invalidate caches and all sort of playing around with it but in vain.

Here is my gradle version..
classpath 'com.android.tools.build:gradle:3.0.1'

And my compile and target android versions:

ext.androidMinSdkVersion    =  15
ext.androidSdkVersion       =  27
ext.androidToolsVersion     =  "27.0.3"

Also I've faced this issue when trying to flash the apk in device:
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process AspectTransform/free/debug/1.jar

Let me know if you need any further information info that i can provide..

@JingYeoh
Copy link
Owner

JingYeoh commented Feb 8, 2018

Sorry, i can't reappear this error with your gradle configuration. please give me the full gradle configuration with project build.gradle , modle build.gradle and gradle-wrapper.properties.

About the second error, you can try add android.enableD8=true In gradle.properties This should work.

https://stackoverflow.com/questions/47137483/android-studio-3-0-dexarchivebuilderexception

@Yhao90
Copy link

Yhao90 commented Feb 8, 2018

哥们,我这也出现了,
image
image

@Yhao90
Copy link

Yhao90 commented Feb 8, 2018

getRigger的时候rigger为空
抛出异常了就

@JingYeoh
Copy link
Owner

JingYeoh commented Feb 8, 2018

@Yhao90 抱歉,我这边无法重现该错误,请贴出你的根目录和module下的build.gradlegradle-wrapper.properties

Repository owner deleted a comment from af913337456 Feb 23, 2018
@Stevemoretz
Copy link

I'm having the same problem.

@Puppet(containerViewId = R.id.frame, stickyStack = true)
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        Rigger.getRigger(this).showFragment(HelloFragment(),R.id.frame)

Fragment class:

@Puppet
class HelloFragment : Fragment() {
        classpath "com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4"
        classpath 'org.aspectj:aspectjtools:1.8.13'
apply plugin: 'android-aspectjx'
    implementation 'com.justkiddingbaby:fragment-rigger:1.4.4'

@Stevemoretz
Copy link

I found the problem,You need to update the library and add support for androidX.I don't know how you've written it but it shouldn't be so hard just letting androidX fragment and Activities be used.Remembering that androidX is nothing but naming convention packages.Not different code.

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

4 participants