1

Hi I am having difficulties getting Magento 2.4.1 to work when Braintree module is enabled. With Braintree enabled I cannot view the product page, i get an error that begins with

Error: Class 'Braintree\Configuration' not found

When I disable the braintree module I can access the product page ok.

When I run

php bin/magento setup:di:compile

I get the following error:

Compilation was started. Area configuration aggregation... 5/9 [===============>------------] 55% 37 secs 288.0 MiB In ClassReader.php line 45: Impossible to process constructor argument Parameter #1 [ Braintree\Transaction $transaction ] of PayPal\Braintree\Model\Report\Row\TransactionMap class In ClassReader.php line 34: Class Braintree\Transaction does not exist setup:di:compile

I have ran setup upgrade, clean and flush cache then tried to di:compile still issues occurs.

Short of a fresh install i cannot think of anything else that may resolve the issue.

Any help would be of great help.

2
  • did you give permissions to whole Magento installation? chmod -R 775 MagentoFolder, also try php bin/magento indexer:reindex and clean cache. Check that braintree module is correct configured. Nov 25, 2020 at 17:54
  • From what I can tell every folder has permissions set to 755 and files set to 644. I have ran the indexer numerous times and issue persists.
    – neit
    Nov 26, 2020 at 14:41

2 Answers 2

2

I contacted Gene for support and as suggest by Petar, the braintree module did not install properly.

Gene advised to me run

composer require braintree/braintree_php:5.2.0

Which resolved the issue.

0

You should freely remove braintree and all other modules that are not essential. Check out https://github.com/yireo/magento2-replace-all to see all the modules that you can remove freely without any issues to your magento installation.

What we do is we create our own module that has just an .json file with the same contents as the one from Yireo, where we remove the modules that we dont want to have in our Magento instance.

2
  • Unfortunately I am not able to do that as Braintree is our main payments processor.
    – neit
    Nov 26, 2020 at 14:46
  • Then check if braintree is properly installed. From the error messages i can see that you magento cannot find the classes. Check if there is any updates for Braintree aswell that are for Magento 2.4.1 Nov 26, 2020 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.