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

Couldn't get dependency '//.okbuck/keystore:app_keystore' of target '//app:bin' #23

Closed
wzpan opened this issue Oct 12, 2015 · 10 comments
Closed
Assignees
Milestone

Comments

@wzpan
Copy link

wzpan commented Oct 12, 2015

I got the following error after I execute buck run app

➜  appframework git:(master) ✗ buck run app       
Using buckd.
[+] PROCESSING BUCK FILES...0.1s
BUILD FAILED: Couldn't get dependency '//.okbuck/keystore:app_keystore' of target '//app:bin':
The build file that should contain //.okbuck/keystore:app_keystore has already been parsed (/Users/hahack/application.okbuck/keystore/BUCK), but //.okbuck/keystore:app_keystore was not found. Please make sure that //.okbuck/keystore:app_keystore is defined in /Users/hahack/application.okbuck/keystore/BUCK.

Here's my root build.gradle:

apply plugin: 'com.github.piasy.okbuck-gradle-plugin' // facebook buck
okbuck {
    target "android-20"
    overwrite true
    resPackages = [
        'app': 'com.hahack.app'
    ]
}

And the content of .okbuck/app/BUCK looks like this:

import re

jar_deps = []
for jarfile in glob(['*.jar']):
    name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
    jar_deps.append(':' + name)
    prebuilt_jar(
        name = name,
        binary_jar = jarfile,
    )

android_library(
    name = 'all-jars',
    exported_deps = jar_deps,
    visibility = [
        'PUBLIC',
    ],
)

aar_deps = []
for aarfile in glob(['*.aar']):
    name = 'aar__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
    aar_deps.append(':' + name)
    android_prebuilt_aar(
        name = name,
        aar = aarfile,
    )

android_library(
    name = 'all-aars',
    exported_deps = aar_deps,
    visibility = [
        'PUBLIC',
    ],
)
@Piasy
Copy link
Contributor

Piasy commented Oct 12, 2015

@wzpan That looks strange, could you please save ./gradlew okbuck --stacktrace's output to a file and attach it in a comment? The file structure of your project, and the content of app/BUCK (not .okbuck/app/BUCK) could also helpful to figure out the cause of this problem. Thanks!

@wzpan
Copy link
Author

wzpan commented Oct 12, 2015

Hi @Piasy ,

Thanks for the rapid response.

could you please save ./gradlew okbuck --stacktrace's output to a file and attach it in a comment?

Something went wrong that I can't attach the log file to the comment. Thus I will send you a mail with the attachment. Please check it out. Thanks again.

@Piasy
Copy link
Contributor

Piasy commented Oct 12, 2015

@wzpan Hi, I didn't receive your email after half hour... is there something wrong? Or maybe you can contact me with QQ: 200842165. Thanks!

@wzpan
Copy link
Author

wzpan commented Oct 12, 2015

Hi @Piasy ,

Sorry I went to have dinner with my friends. Now you should have got the email! Thanks.

@Piasy
Copy link
Contributor

Piasy commented Oct 12, 2015

@wzpan Hi, I can reproduce your problem with version 0.2.5, which didn't support multiple application module, a newer version 0.2.6 fix it, so could you please give version 0.2.6 a trial? Thanks!

@wzpan
Copy link
Author

wzpan commented Oct 13, 2015

Ok. I'll try it this afternoon.

@wzpan
Copy link
Author

wzpan commented Oct 13, 2015

Hi @Piasy ,

I switch to use 0.2.6 and now I come across another problem.

For application module, I got the following error:

➜  appframework git:(master) ✗ buck run hfcache_example
Using watchman.
Using buckd.
[+] PROCESSING BUCK FILES...0.6s [100%]
BUILD FAILED: Couldn't get dependency '//hfasynchttp:res' of target '//hfcache_example:src':
//hfasynchttp:res: parameter 'res': no such file or directory 'hfasynchttp/src/main/res'

And for library module, I got the following error:

➜  appframework git:(master) ✗ buck run hfcache        
Using buckd.
[+] PROCESSING BUCK FILES...0.2s [100%]
BUILD FAILED: No rule found when resolving target //hfcache:hfcache in build file //hfcache/BUCK
Defined in file: /Users/hahack/hyperion/hyperion-sdk/afengine/android/framework/appframework/hfcache/BUCK

@Piasy
Copy link
Contributor

Piasy commented Oct 13, 2015

@wzpan Well, I must admit that your project is a really big one, with many modules, which I didn't take into consideration when develop OkBuck. So I can imagine that there must be more problems waiting for you, and me too.

To address your problems, and improve OkBuck, more efficiently, would you mind to make contact with me through some IM tools? e.g. QQ: 200842165, WeChat: piasy_umumu.

@Piasy
Copy link
Contributor

Piasy commented Oct 13, 2015

In summary, there are three problems:

  1. If an android library module doesn't have a res folder, OkBuck will generate the wrong BUCK file, and this will be fixed soon;
  2. If your project is under other version control system than git, e.g. git-svn, BUCK will try to recognize files under these folders, which should be ignored, and I'll add .svn ignore support in OkBuck soon, but I still suggest you use git :) ;
  3. BuildConfig problems, custom build config should be defined inside defaultConfig block of build.gradle file, otherwise, OkBuck and BUCK will ignore these custom fields.

@Piasy
Copy link
Contributor

Piasy commented Oct 14, 2015

Above problems is fixed by 09e9f6e and c30fd68.

@Piasy Piasy closed this as completed Oct 14, 2015
@Piasy Piasy added this to the v1.0.0 milestone Oct 14, 2015
@Piasy Piasy self-assigned this Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants