googleads / googleads-java-lib

Google Ad Manager SOAP API Client Library for Java
Apache License 2.0
226 stars 360 forks source link

Java: package com.google.ads.googleads.test does not exist #223

Closed hommedahl15 closed 3 years ago

hommedahl15 commented 3 years ago

I tried to run the GetCampaigns.java file and got this error. "Java: package com.google.ads.googleads.test does not exist"

image

Any idea why this is happening?

jradcliff commented 3 years ago

The library uses annotation processors during the build. If using IntelliJ, you can make sure annotation processing is enabled by going to Build, Execution, Deployment -> Compiler -> Annotation processors, then selecting google-ads, and checking Enable annotation processing. That package isn't generated by annotation processors, but if they don't run it could cause other build steps to fail.

Thanks

hommedahl15 commented 3 years ago

I enabled the annotation process, but it's still returning the same error "java: package com.google.ads.googleads.test does not exist" after running the GetCampaigns.java file.

It opens the ReflectionFieldAccessorTest.java file after running GetCampagins.java. Note that I have not done anything else with this library. I've cloned it & enabled annotation processing. Are there any other necessary steps that I have not completed? Thank you for the help!

image

image

jradcliff commented 3 years ago

Hi,

I was able to reproduce the issue you were having on a newly created project. What fixed it for me was to manually run the test phase in IntelliJ.

maven

That forced the generate-test-sources phase to run, which is the phase that produces the missing package.

Note that I had to restart IntelliJ after running that phase.

Thanks, Josh

P.S. For any future issues with the google-ads-java project, please use that project's issue tracker at https://github.com/googleads/google-ads-java/issues. This project (googleads-java-lib) is for the previous API.