kodecocodes / aa-materials Goto Github PK
View Code? Open in Web Editor NEWThe projects and the materials that accompany the Android Apprentice book.
License: Apache License 2.0
The projects and the materials that accompany the Android Apprentice book.
License: Apache License 2.0
/home/[user.name]/AndroidStudioProjects/Podplay/app/build/generated/source/kapt/debug/db/PodcastDao_Impl.java:3: error: package android.database does not exist
import android.database.Cursor;
^
/home/[user.name]/AndroidStudioProjects/Podplay/app/build/generated/source/kapt/debug/db/PodPlayDatabase_Impl.java:128: error: cannot access Context
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(configuration.context)
^
class file for android.content.Context not found
/home/[user.name]/AndroidStudioProjects/Podplay/app/build/generated/source/kapt/debug/db/PodPlayDatabase_Impl.java:147: error: cannot access VERSION
boolean _supportsDeferForeignKeys = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP;
^
class file for android.os.Build$VERSION not found
/home/[user.name]/AndroidStudioProjects/Podplay/app/build/generated/source/kapt/debug/db/PodcastDao_Impl.java:168: error: cannot find symbol
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
^
symbol: class Cursor
/home/[user.name]/AndroidStudioProjects/Podplay/app/build/generated/source/kapt/debug/db/PodcastDao_Impl.java:246: error: cannot find symbol
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
^
symbol: class Cursor
location: class PodcastDao_Impl
5 errors
Hi,
The method mentioned above has been deprecated, I'm wondering if there is any simple way to replace it...? It might not cause issues now, but later due to incompatibility issues.
The final project in CH15 is the first time this file is created. The changes here need to be propagated to the chapters building on this.
I can't run any project from this repo on my mac mini M1. Everything works normal on my Intel machine.
I'm getting error like this:
Gradle sync failed: Sync failed: reason unknown
Please, help me to resolve this issue.
My Android Gradle Plugin version - 4.1.2
My gradle version - 6.5
BTW if I create new project on my Intel machine and open it in my M1 - everything works
There is a runtime exception in chapter 6 v4.0 of the book. Following chapter 6 the app will build and run but it will immediately crash. Looking at Logcat the reason is as follows:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
This appears to be a result of the AndroidManifest.xml inheriting the theme from themes.xml
I was able to fix this by making the following changes:
In AndroidManifest.xml define the app theme to AppCompat.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat"> <!-- Set to this theme -->
And removing the theme definition from themes.xml.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
<style name="Theme.YourAppName" parent="android:Theme.Material.Light.NoActionBar" />
-->
</resources>
Alternative solution.
AndroidManifest.xml:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.YOURAPP">
themes.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.YOURAPP" parent="@style/Theme.AppCompat" />
</resources>
More info at: https://stackoverflow.com/a/21815015/1004227
My environment:
Android Studio Flamingo | 2022.2.1 Patch 2
Build #AI-222.4459.24.2221.10121639, built on May 12, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.