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

LoggedErrorException #25

Closed
KChernenko opened this issue Dec 4, 2014 · 9 comments
Closed

LoggedErrorException #25

KChernenko opened this issue Dec 4, 2014 · 9 comments

Comments

@KChernenko
Copy link

Hello! When I'm trying to include the library into my project, I'm getting an error:

:alertdialogpro-core:processDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':alertdialogpro-core:processDebugResources'.

    com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    C:\Android\sdk\build-tools\21.0.0\aapt.exe package -f --no-crunch -I C:\Android\sdk\platforms\android-21\android.jar -M C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug\AndroidManifest.xml -S C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\res\debug -A C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug\assets -m -J C:\Android\Projects\MealControl\alertdialogpro-core\build\generated\source\r\debug --debug-mode --custom-package com.alertdialogpro --non-constant-id -0 apk --output-text-symbols C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug
    Error Code:
    -1073741819

How to slove this problem?

@fengdai
Copy link
Owner

fengdai commented Dec 5, 2014

Can you provide more details about how you include the library?

@KChernenko
Copy link
Author

My project -> New module -> Import Existing Project -> Source directory: alertdialogpro-core folder.

@fengdai
Copy link
Owner

fengdai commented Dec 6, 2014

You can use Gradle dependence now:

 compile 'com.github.fengdai:alertdialogpro-theme-material:0.1.0'

Since this release hasn't been synchronized to Maven Central, don't forget to add this:

repositories {
    maven {
         url 'https://oss.sonatype.org/content/groups/staging/'
     } 
 }

I'll write here to let you know when I finish sync. At that time, your can use Maven Central repo:

repositories {
    mavenCentral()
}

@KChernenko
Copy link
Author

Import works fine, but when I'm trying to initialize a dialog:

AlertDialogPro.Builder builder = new AlertDialogPro.Builder(context);
builder.setTitle("Title").
setIcon(R.drawable.ic_launcher).
setMessage("Message").
setNeutralButton("Neutral", null).
setPositiveButton("OK", null).
setNegativeButton("Cancel", null).
show();

I get an exception:

android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1131)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2327)
at android.content.res.Resources.getLayout(Resources.java:947)
at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:297)
at com.alertdialogpro.internal.AlertController.installContent(AlertController.java:193)
at com.alertdialogpro.AlertDialogPro.onCreate(AlertDialogPro.java:166)
at android.app.Dialog.dispatchOnCreate(Dialog.java:369)
at android.app.Dialog.show(Dialog.java:270)
at com.alertdialogpro.AlertDialogPro$Builder.show(AlertDialogPro.java:774)
at bitfrom.me.mealcontrol.views.MealConfigFragment$1.onClick(MealConfigFragment.java:34)
at com.gc.materialdesign.views.Button.makeCircle(Button.java:123)
at com.gc.materialdesign.views.ButtonRectangle.onDraw(ButtonRectangle.java:128)

@fengdai
Copy link
Owner

fengdai commented Dec 7, 2014

Did you only import the alertdialogpro-core lib? If so, you will get this exception. That's because there is no resource files in core lib.The core lib is used for full customization a brand new theme. If you don't want do full customization and you wanna material theme. I suggest you to let your project depend on the alertdialogpro-theme-material lib inside of core lib.

@fengdai
Copy link
Owner

fengdai commented Dec 7, 2014

And, remember to specify alertdialogpro's theme in your app' theme:

<style name="AppTheme" parent="AppBaseTheme">
    ...
    <item name="alertDialogProTheme">@style/Theme.AlertDialogPro.Material</item>
</style>

@fengdai
Copy link
Owner

fengdai commented Dec 8, 2014

Hi, what about now?

@KChernenko
Copy link
Author

Oh, sorry. Thanks! It works pretty well)

@fengdai
Copy link
Owner

fengdai commented Dec 9, 2014

I have synchronized this release to Maven Central. Now your can use:

repositories {
    mavenCentral()
}

@fengdai fengdai closed this as completed Dec 9, 2014
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