Error invalid magic number

I have a project on GitHub that I work on both in the office at home. For about 2 months it was working fine on both machines. Then two weeks ago, it stopped running on my home PC, but still works fine on my work PC.

This is the error I get:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:app:shrinkDebugMultiDexComponents’. java.io.IOException: Can’t read [D:devgitRepoappandroidappuildintermediatesmulti-dexdebugallclasses.jar] (Can’t process class [__MACOSX/com/stripe/android/._BuildConfig.class] (Invalid magic number [51607] in class))
  • Try: Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.

The stripe package that is giving me errors is a 3rd party library that you can find here. I list it as a dependency in my build.gradle file exactly as they say to.

I have commented out all code pertaining the stripe and the app runs completely fine, so I do know it has something to do with how I am handling that package.

Unfortunately I don’t remember exactly what I had done to make this stop working. I do think that the week before this happened I upgraded Android Studio, and spent a considerable amount of time messing with ProGuard configurations.

What I have tried:

  • Working on the master branch where no ProGuard changes have been made.
  • Uninstalling and Reinstalling Android Studio
  • Re-cloning the git repo
  • Installing API 17 (stripe for eclipse requires this. Not Studio but I gave it a shot).
  • Contacting stripe customer support but they had no clue.
  • This stack overflow post. However, there is no Mac computer that has touched the project nor have I personally zipped anything related to stripe .
  • From here, converted the magic number from Hex to ASCII. The result was Q` which I do not recognize.

I think it may have something to do with something I did for ProGuard, but I don’t understand how. I’m on a completely different branch than any Proguard work, with a clean AndroidStudio install, with a clean repository clone, and the project still works fine when I’m in the office.

EDIT

I am running this on the debug BuildType. These are my 3 gradle files. The first is for the entire Project, the second is for the Application Module, and the third is for a local android library Module.

Читайте также:  Capable and status ok зависает

У меня есть проект GitHub, который я работаю как в офисе дома. В течение примерно 2 месяцев он работал нормально на обеих машинах. Затем две недели назад она перестала работать на моем домашнем ПК, но все еще отлично работает на моем рабочем ПК .

Это ошибка, которую я получаю:

: Приложение: shrinkDebugMultiDexComponents FAILED

FAILURE: Сбой сборки с исключением.

  • Что пошло не так: выполнение завершилось неудачно для задачи: app: shrinkDebugMultiDexComponents. Java.io.IOException: не удается прочитать [D: dev gitRepo app android app build intermediates multi-dex debug allclasses.jar] (невозможно обработать класс [__MACOSX / com / stripe /android/._BuildConfig.class] (Недопустимый магический номер [51607] в классе))
  • Попробуйте: запустите с опцией –stacktrace, чтобы получить трассировку стека. Запустите с опцией –info или –debug, чтобы получить больше выходных данных журнала.

Пакет stripe , который дает мне ошибки, является сторонней библиотекой, которую вы можете найти здесь . Я перечисляю его как зависимость в файле build.gradle точно так, как они говорят.

Я прокомментировал весь код, относящийся к stripe и приложение работает полностью нормально, поэтому я знаю, что это имеет какое-то отношение к тому, как я обрабатываю этот пакет.

К сожалению, я не помню точно, что я сделал, чтобы эта работа перестала работать. Я думаю, что за неделю до этого я обновил Android Studio и потратил немало времени на общение с конфигурациями ProGuard .

То, что я пробовал:

  • Работа над master веткой, где не было изменений ProGuard .
  • Удаление и переустановка Android Studio
  • Повторное клонирование git repo
  • Установка API 17 (для этого требуется полоса для eclipse. Not Studio, но я дал ей шанс).
  • Обращение в службу поддержки пользователей полосы, но они не имели понятия.
  • Это переполнение стека . Тем не менее, нет компьютера Mac, который коснулся проекта, и лично я не закрепил все, что связано с stripe .
  • Отсюда преобразуется магическое число с Hex на ASCII. Результат был Q`, который я не узнаю.

Я думаю, что это может иметь какое-то отношение к тому, что я сделал для ProGuard, но я не понимаю, как это сделать. Я нахожусь в совершенно другой ветке, чем любая работа Proguard, с чистой установкой AndroidStudio, с чистым клоном репозитория, и проект все еще отлично работает, когда я нахожусь в офисе.

Читайте также:  Samsung galaxy note 9 mvideo

РЕДАКТИРОВАТЬ

Я запускаю это на debug BuildType. Это мои 3 файла градиента. Первый для всего проекта, второй для модуля приложения, а третий для локального модуля библиотеки Android.

Android Application Module build.gradle

Локальный модуль библиотеки Android build.gradle

Вероятно, эта проблема связана с версией Java, которую вы используете. У меня была аналогичная проблема, и я обнаружил, что Java 8 используется для сборки. Когда я перешел на Java 7, эта проблема была исправлена.

В Android Studio перейдите к

JDK Location должно быть Java 1.7.x (Java 7)

Да, убедитесь, что обе машины имеют одну и ту же версию Java и действительно ту же версию Android Studio. Единственное, что я могу подумать, это то, что, возможно, Stripe использует инструменты сборки в комплекте с AS для сборки вашего apk, а те, которые вы установили по умолчанию, немного отличаются и чего-то не хватает – см. Этот пост, который я сделал по аналогичной проблеме I Был .

Comments

Copy link Quote reply

alexander-brett commented May 30, 2015

Error occurs when trying to load the kernel. The partition is FAT32 and the drive has an MBR. I’m on a MacBook Pro (13-inch, Mid 2009).

This comment has been minimized.

Copy link Quote reply

SevenBits commented May 30, 2015

Can you post a screenshot of the error? It’s important that I see the actual error message.

This comment has been minimized.

Copy link Quote reply

alexander-brett commented Jun 1, 2015

Not sure how to screenshot a grub error — literal photo?

This comment has been minimized.

Copy link Quote reply

SevenBits commented Jun 1, 2015

Not sure how to screenshot a grub error — literal photo?


Reply to this email directly or view it on GitHub.

This comment has been minimized.

Copy link Quote reply

SevenBits commented Jul 24, 2015

@alexander-brett Unless you can provide more information, I’m going to close this thread. If this remains an issue, please re-open.

This comment has been minimized.

Copy link Quote reply

dmitryfd commented Aug 11, 2015

I am getting the same issue with Kali Linux 2.0 (running on rMBP 13′ Late 2013).
I was initially having the same issue as described here, so I added an extra character to the kernel name in the config.

Читайте также:  Ite it8211 ata atapi controller

Now, the errors look something like this:

Loading kernel. error: invalid magic number
Loading RAM disk. error: you need to load the kernel first

I can provide you with a photo of that screen, if needed.
Any ideas how I could approach fixing it? Thanks in advance!

This comment has been minimized.

Copy link Quote reply

SevenBits commented Aug 12, 2015

@dmitryfd Yes, please send a photo, and also post your Enterprise configuration file. Which version of Mac Linux USB Loader are you using?

This comment has been minimized.

Copy link Quote reply

dmitryfd commented Aug 12, 2015

@SevenBits, I am using 3.1beta2.
Before I do that, someone online suggested that problem might actually be with a USB drive (bad sectors). I am trying right now with a different one and will report my findings.

This comment has been minimized.

Copy link Quote reply

dmitryfd commented Aug 12, 2015

Nope, it’s the same error, sadly 🙁

This comment has been minimized.

Copy link Quote reply

SevenBits commented Aug 12, 2015

@dmitryfd Can you verify that your ISO isn’t corrupted?

This comment has been minimized.

Copy link Quote reply

dmitryfd commented Aug 12, 2015

@SevenBits It actually could be the case. I was downloading the image via torrents and it seems like I am having SHA1 sum mismatch. I am redownloading and will try again tonight. Will update here if that solved it.

This comment has been minimized.

Copy link Quote reply

dmitryfd commented Aug 12, 2015

Yup, redownloading the image actually fixed it.

Thanks for your time and sorry for troubling you!

This comment has been minimized.

Copy link Quote reply

SevenBits commented Aug 12, 2015

@dmitryfd No problem, I’m glad you got it working! Feel free to donate if the program helped you.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *