How to compile an Android app with aapt2 without using any build tools?

前端 未结 2 831
感动是毒
感动是毒 2020-12-21 20:09

I\'m trying to compile an Android application I just created in Kotlin on Android Studio, without using Gradle or any other build tools. My intention is to speed up compilin

2条回答
  •  囚心锁ツ
    2020-12-21 20:49

    Actually it is very difficult and messy to use extra support libraries, You are getting those errors, because you are using support library's theme which is not a part of android.jar, Instead you can use android.jar's default theme. Just put

    public  class MainActivity extends Activity {...}
    

    in place of

    public  class MainActivity extends AppCompatActivity {...}
    

    and change your manifest's App theme pointing to 'styes.xml', So basically you have to change the styles XML file to this one

    
    
        
        
    
        
        
    
    
    

    Also you should use below code in 'Manifest.xml' file to point the Theme of your project or Activity in Styles XML file under values

    android:theme="@style/AppTheme"
    

    this reference article is very helpful for what exactly you are trying to dohttps://geosoft.no/development/android.html, Also sign your APK in order to run your app on device, otherwise it can show error while installing. Thanks.

提交回复
热议问题