Я пытаюсь скомпилировать приложение Android, которое я только что создал в Kotlin на Android Studio, без использования Gradle или каких-либо других инструментов сборки. Мое намерение состоит в том, чтобы ускорить компиляцию приложений без необходимости использовать Android Studio или устанавливать инструменты сборки, такие как Gradle, ant или buck. Я сталкиваюсь с проблемой, связывающей файлы с aapt2.
Я собираю все файлы из папки res в zip-файл с aapt2. Но когда я пытаюсь связать их, aapt2 выдает ошибки.
Кажется, что ошибки связаны с отсутствующими библиотеками приложений, и мои вопросы заключаются в том, как успешно связать все эти файлы и файлы kotlin для создания развертываемого файла apk.
Следующее компилирует все файлы в папке res и создает файл resources.zip.
$AAPT compile --dir $APP_DIR/src/main/res -o $APP_DIR/build/intermediate/resources.zip
Это, однако, не удается.
$AAPT link -o $APP_DIR/build/intermediate/ -I $PLATFORM $APP_DIR/build/intermediate/resources.zip --manifest $APP_DIR/src/main/AndroidManifest.xml
со следующими ошибками
error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.example.myapplication:style/Theme.AppCompat.Light.DarkActionBar) not found.
./projects/MyApplication/app/src/main/res/values/styles.xml:6: error: style attribute 'attr/colorPrimary (aka com.example.myapplication:attr/colorPrimary)' not found.
./projects/MyApplication/app/src/main/res/values/styles.xml:7: error: style attribute 'attr/colorPrimaryDark (aka com.example.myapplication:attr/colorPrimaryDark)' not found.
./projects/MyApplication/app/src/main/res/values/styles.xml:8: error: style attribute 'attr/colorAccent (aka com.example.myapplication:attr/colorAccent)' not found.
error: resource style/ThemeOverlay.AppCompat.Dark.ActionBar (aka com.example.myapplication:style/ThemeOverlay.AppCompat.Dark.ActionBar) not found.
./projects/MyApplication/app/src/main/res/values/styles.xml:11: error: style attribute 'attr/windowActionBar (aka com.example.myapplication:attr/windowActionBar)' not found.
./projects/MyApplication/app/src/main/res/values/styles.xml:12:
error: style attribute 'attr/windowNoTitle (aka com.example.myapplication:attr/windowNoTitle)' not found.
error: resource style/ThemeOverlay.AppCompat.Light (aka com.example.myapplication:style/ThemeOverlay.AppCompat.Light) not found.
ошибка: не удалось связать ссылки.
Похоже, это связано с отсутствующими библиотеками приложений. Я пытался вручную загрузить файл appcompat-v7-27.1.1.aar и связать его, но это не помогло.
Если кто-нибудь сталкивался с решением этой проблемы, пожалуйста, просветите меня. Благодаря.
Я хочу повторить то, что доступно здесь, с aapt2
https://github.com/authmane512/android-project-template/blob/master/build.sh