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

Rake failed when I added my resources such as styles.xml #30

Open
Zerowxm opened this issue Mar 6, 2016 · 4 comments
Open

Rake failed when I added my resources such as styles.xml #30

Zerowxm opened this issue Mar 6, 2016 · 4 comments

Comments

@Zerowxm
Copy link

Zerowxm commented Mar 6, 2016

error log:

./resources/values/styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.

./resources/values/styles.xml:8: error: Error: No resource found that matches the given name: attr 'colorAccent'.

./resources/values/styles.xml:6: error: Error: No resource found that matches the given name: attr 'colorPrimary'.

in my styles.xml:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/primary</item>
        <item name="colorPrimaryDark">@color/primary_dark</item>
        <item name="colorAccent">@color/accent</item>
        <item name="android:textColorPrimary">@color/primary_text</item>
        <item name="android:textColorSecondary">@color/secondary_text</item>
        <item name="android:divider">@color/divider</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowActionBarOverlay">true</item>
        <item name="windowNoTitle">true</item>
    </style>

I've use motion-gradle to add the support lib
here is my rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/android'
require 'rubygems'
require 'motion-gradle'
begin
  require 'bundler'
  Bundler.require
rescue LoadError
end

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'Ruby'
  app.api_version='21'
  app.theme="@styles/AppTheme"
  app.gradle do
    repository 'https://bintray.com/bintray/jcenter'
    repository 'http://dl.bintray.com/austintaylor/gradle'
    repository 'com.android.support:appcompat-v7:23.1.1'
    repository 'com.android.support:design:23.1.1'
    repository 'pl.droidsonroids.gif:android-gif-drawable:1.1.10'
    repository 'com.android.support:cardview-v7:23.1.1'
    repository 'com.jakewharton:butterknife:7.0.1'
    repository 'com.squareup.picasso:picasso:2.5.2'
    repository 'com.gordonwong:material-sheet-fab:1.2'
    repository 'com.android.support:support-v4:23.1.1'
    repository 'com.bigkoo:pickerview:2.0.3'
    repository 'com.google.code.gson:gson:2.5'
    repository 'com.mcxiaoke.volley:library:1.0.19'
    repository 'com.squareup.okhttp3:okhttp:3.1.2'
    repository 'de.hdodenhof:circleimageview:1.3.0'
  end

end

and the directory is here:
---resources
---values
---styles.xml

and if I delete my styles.xml,you know the other layout file will go out more error,and I want use the AppCompatActivity but it does not work.

@jjaffeux
Copy link
Contributor

jjaffeux commented Mar 6, 2016

You need to add support v7 for this, you only set repositories and not the support library, this can't work.

If you have added android support repository as explained in the Readme, I think this should be enough:

app.gradle do
  repository 'com.android.support:appcompat-v7:23.1.1'
end

@Zerowxm
Copy link
Author

Zerowxm commented Mar 7, 2016

@jjaffeux actually,I do not understand your meaning,I've added this line in my rakefile,where need I also add?I'm so sorry I cannot get it.

@Zerowxm
Copy link
Author

Zerowxm commented Mar 11, 2016

@jjaffeux Hello, can you hlep me with this problem? Many thanks!

@jjaffeux
Copy link
Contributor

@Zerowxm Build a sample project I can build, and will give it a look

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