Android Gossis Android Fragen Thread

Gossi

Bekanntes Mitglied
Hallo,

Ich weiß, dieser Fehler ist ziemlich bekannt, aber dennoch haben die Lösungen bei google nichts gebracht, hier erstmal ein bisschen Code:

Java:
import android.app.Activity;
import android.os.Bundle;

public class TestAppActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}
}

[XML]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:eek:rientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />

</LinearLayout>
[/XML]

[XML]
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="hello">Hello World, TestAppActivity!</string>
<string name="app_name">TestApp</string>

</resources>
[/XML]

Folgende Lösungen habe ich bereits ausprobiert:
  • import android.R entfernt
  • Projekt clean und build
  • Die .xml-Files verändert und neu gespeichert
  • Neues Projekt angelegt
  • Run versucht

Das hat aber alles nicht geholfen, Eclipse erzeugt die R.java Klasse nicht, bei mir ist gem eh komplett leer, ich weiß langsam echt nicht mehr weiter, hoffe ihr könnt mir helfen.

Gruß Gossi
 
Zuletzt bearbeitet von einem Moderator:

Gossi

Bekanntes Mitglied
Hmm, jetzt hab ich ein neues Problem, nach dem (Per Refactor) umbennenen einer Klasse (TestApp) in "StaumeldungErfassen" bekomme ich folgenden fehler:

[2012-04-20 10:51:09 - TestApp] ERROR: Unknown command 'crunch'
[2012-04-20 10:51:09 - TestApp] Android Asset Packaging Tool
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] Usage:
[2012-04-20 10:51:09 - TestApp] aapt l[ist] [-v] [-a] file.{zip,jar,apk}
[2012-04-20 10:51:09 - TestApp] List contents of Zip-compatible archive.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
[2012-04-20 10:51:09 - TestApp] badging Print the label and icon for the app declared in APK.
[2012-04-20 10:51:09 - TestApp] permissions Print the permissions from the APK.
[2012-04-20 10:51:09 - TestApp] resources Print the resource table from the APK.
[2012-04-20 10:51:09 - TestApp] configurations Print the configurations in the APK.
[2012-04-20 10:51:09 - TestApp] xmltree Print the compiled xmls in the given assets.
[2012-04-20 10:51:09 - TestApp] xmlstrings Print the strings of the given compiled xml assets.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \
[2012-04-20 10:51:09 - TestApp] [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \
[2012-04-20 10:51:09 - TestApp] [--min-sdk-version VAL] [--target-sdk-version VAL] \
[2012-04-20 10:51:09 - TestApp] [--app-version VAL] [--app-version-name TEXT] [--custom-package VAL] \
[2012-04-20 10:51:09 - TestApp] [--rename-manifest-package PACKAGE] \
[2012-04-20 10:51:09 - TestApp] [--rename-instrumentation-target-package PACKAGE] \
[2012-04-20 10:51:09 - TestApp] [--utf16] [--auto-add-overlay] \
[2012-04-20 10:51:09 - TestApp] [-I base-package [-I base-package ...]] \
[2012-04-20 10:51:09 - TestApp] [-A asset-source-dir] [-G class-list-file] [-P public-definitions-file] \
[2012-04-20 10:51:09 - TestApp] [-S resource-sources [-S resource-sources ...]] [-F apk-file] [-J R-file-dir] \
[2012-04-20 10:51:09 - TestApp] [raw-files-dir [raw-files-dir] ...]
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] Package the android resources. It will read assets and resources that are
[2012-04-20 10:51:09 - TestApp] supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F and -R
[2012-04-20 10:51:09 - TestApp] options control which files are output.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
[2012-04-20 10:51:09 - TestApp] Delete specified files from Zip-compatible archive.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
[2012-04-20 10:51:09 - TestApp] Add specified files to Zip-compatible archive.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] aapt v[ersion]
[2012-04-20 10:51:09 - TestApp] Print program version.
[2012-04-20 10:51:09 - TestApp]
[2012-04-20 10:51:09 - TestApp] Modifiers:
[...]
[2012-04-20 10:51:09 - TestApp] ERROR: Unknown option '--no-crunch'
[2012-04-20 10:51:09 - TestApp] Android Asset Packaging Tool
[...]
[2012-04-20 10:51:09 - TestApp] level is set to 7 or higher where the default encoding is UTF-8.
[2012-04-20 10:51:09 - TestApp] Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
[2012-04-20 10:54:48 - TestApp] ERROR: Unknown command 'crunch'
[2012-04-20 10:54:48 - TestApp] Android Asset Packaging Tool
[2012-04-20 10:54:48 - TestApp]
[2012-04-20 10:54:48 - TestApp] Usage:
[2012-04-20 10:54:48 - TestApp] aapt l[ist] [-v] [-a] file.{zip,jar,apk}
[2012-04-20 10:54:48 - TestApp] List contents of Zip-compatible archive.
[...]
[2012-04-20 11:06:02 - TestApp] --rename-instrumentation-target-package
[2012-04-20 11:06:02 - TestApp] Rewrite the manifest so that all of its instrumentation
[2012-04-20 11:06:02 - TestApp] components target the given package. Useful when used in
[2012-04-20 11:06:02 - TestApp] conjunction with --rename-manifest-package to fix tests against
[2012-04-20 11:06:02 - TestApp] a package that has been renamed.
[2012-04-20 11:06:02 - TestApp] --utf16
[2012-04-20 11:06:02 - TestApp] changes default encoding for resources to UTF-16. Only useful when API
[2012-04-20 11:06:02 - TestApp] level is set to 7 or higher where the default encoding is UTF-8.
[2012-04-20 11:06:02 - TestApp] Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!

Ich habe bereits bei "platform-tools" nach der dx.jar gesucht, diese auch gefunden. Im Internet bin ich auf die Lösung gekommen, die dx.jar mit der dx.jar aus dem (platform)/tools/lib Ordner zu ersetzen, auch das hat nicht geholfen, weiß jemand woher dieser Fehler kommen könnte?

Was ich auch nicht verstehe "a package that has been renamed.", dabei wurden die Packagenamen behalten...

PS:
Ich arbeite gerade das Buch "Android Grundlagen und Programmierung" durch
 
Zuletzt bearbeitet:

Gossi

Bekanntes Mitglied
Moin,

Ich bin moentan dabei, eine art Notizplaner zu erstellen. Jetzt komme ich aber zu folgendem Problem (bitte bringt mich für den Code nicht um)

Ich führe für jeden TextView der hinzugefügt werden soll folgendes aus:

Java:
if (((EditText) findViewById(R.id.newNote)).getText().length() > 0) {
	TableRow tr = new TableRow(this);
	tr.setLayoutParams(new TableRow.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	TextView tv = new TextView(this);
	tv.setLayoutParams(new TableRow.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	tv.setText(((EditText) findViewById(R.id.newNote)).getText()
			.toString());
	tr.addView(tv);
	((TableLayout) findViewById(R.id.tabelleNotizen)).addView(tr,
			new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT,
					LayoutParams.WRAP_CONTENT));
	((TableLayout) findViewById(R.id.tabelleNotizen)).invalidate();
	((EditText) findViewById(R.id.newNote)).setText("");
}

Wie kann ich den einzelnen Rows jetzt einen LongKlickListener hinzufügen?

PS:
Den fehler mit dem dx.jar File hab ich damit gelöst, das ich den ganzen android Kram nochmal runtergeladen habe.
 
Zuletzt bearbeitet:
Ähnliche Java Themen
  Titel Forum Antworten Datum
J Benachrichtigung Freigabe ab Android 14 Android & Cross-Platform Mobile Apps 1
J Android Benachrichtigung zum Zeitpunkt ers Android & Cross-Platform Mobile Apps 15
J Das Beispiel von Android erzeugt Fehler Android & Cross-Platform Mobile Apps 8
J Zeitdifferenzen unter Android 7 (API < 26) berechnen Android & Cross-Platform Mobile Apps 4
W Netzwerk Verbindungen Java Android Android & Cross-Platform Mobile Apps 107
Z Android IntelliJ Android & Cross-Platform Mobile Apps 2
M Repository bei Room-Database in Android Studio (Java) Android & Cross-Platform Mobile Apps 2
Android App auf das eigene Handy bekommen Android & Cross-Platform Mobile Apps 3
Alex IV Android App erstellen Android & Cross-Platform Mobile Apps 3
OnDemand CrossPlatform Kotlin iOs/Android Datenverbrauch Android & Cross-Platform Mobile Apps 2
W In Android Studio Integer an andere activities übergeben Android & Cross-Platform Mobile Apps 2
wladp Android Studio Room Database Android & Cross-Platform Mobile Apps 1
N "Schöne" Datatable in Android und setzen von Parametern von Textview im Code Android & Cross-Platform Mobile Apps 5
N Android game programmieren Android & Cross-Platform Mobile Apps 5
T Android Studio: Einen Button in einer For Schleife verwenden Android & Cross-Platform Mobile Apps 2
K BLE Komunikation mit Android studio und esp32 Android & Cross-Platform Mobile Apps 5
G Android UDP Kommunikation Android & Cross-Platform Mobile Apps 1
M Paper DB wird in Android Studio nicht erkannt Android & Cross-Platform Mobile Apps 7
J Android zugrif auf Thread nach Handy drehen. Android & Cross-Platform Mobile Apps 10
T Android Android Augmented Faces in Java. Neue Landmarks erstellen Android & Cross-Platform Mobile Apps 1
K Android Android In-App-Purchase lädt nicht Android & Cross-Platform Mobile Apps 0
Besset Android http request an interne ip adresse funktioniert nicht Android & Cross-Platform Mobile Apps 8
J Is Android Development Head First Outdated? Android & Cross-Platform Mobile Apps 3
J Android Android Datenbankverbindung zum Raspberry Pi Android & Cross-Platform Mobile Apps 1
lolcore Android Studio -Download Documentation for Android SDK Android & Cross-Platform Mobile Apps 0
S Sinnvollste weg eine SQLite DB mit Android auslesen Android & Cross-Platform Mobile Apps 7
W Problem mit Android Studio Android & Cross-Platform Mobile Apps 0
W App Abo Android Android & Cross-Platform Mobile Apps 10
OSchriever Android Android MediaPlayer bei Anruf stoppen/pausieren Android & Cross-Platform Mobile Apps 2
OSchriever Auf onClick-Listener reagieren und Parameter übergeben (Android Studio) Android & Cross-Platform Mobile Apps 4
W removeNetwork Android App mit Spendenaktion fürs Tierheim! Android & Cross-Platform Mobile Apps 1
T Android R.string.test+i Problem Android & Cross-Platform Mobile Apps 2
P undefinierbarer Fehler Android Android & Cross-Platform Mobile Apps 8
T Android ArrayList sortieren mit 2 Werten ohne thencomparing , Wie? Android & Cross-Platform Mobile Apps 10
W Variable überschreiben (Android Studio) Android & Cross-Platform Mobile Apps 2
ruutaiokwu Android Selbst entwickelter SMTP-Client läuft auf PC, nicht aber auf Android Android & Cross-Platform Mobile Apps 9
ruutaiokwu Android Warum muss man bei Android Studio immer 2x auf "Run" klicken damit die App auf dem Gerät startet Android & Cross-Platform Mobile Apps 8
ruutaiokwu Android Wo das 'android.useAndroidX' property hinzufügen? Android & Cross-Platform Mobile Apps 8
ruutaiokwu Android In einem Android-“Spinner”-Element GLEICHZEITIG Bild (links) UND Text (rechts) anzeigen Android & Cross-Platform Mobile Apps 0
P Login und Registrierung Android Anzeige Android & Cross-Platform Mobile Apps 7
S Von JavaFx zu Android Android & Cross-Platform Mobile Apps 12
K Android to Pi | Websocket Problem Android & Cross-Platform Mobile Apps 3
ruutaiokwu Wie fügt man bei Android Studio .jar-Libraries zu einem Android-Java-Projekt hinzu? Android & Cross-Platform Mobile Apps 33
M Komponenten positionieren in Android Studio 3.6.3 Android & Cross-Platform Mobile Apps 1
M Android Studio - Property-Fenster einblenden Android & Cross-Platform Mobile Apps 1
M Android Studio - App auf dem Smartphone testen Android & Cross-Platform Mobile Apps 7
M Barrierefreie Appentwicklung für Android - Suche Codebeispiele Android & Cross-Platform Mobile Apps 8
M Android Studio - Configuration fehlt Android & Cross-Platform Mobile Apps 20
M Wo kann ich das Android SDK herunterladen / wie kann ich es installieren Android & Cross-Platform Mobile Apps 3
M Unsupported class file major version 57 - Fehlermeldung bei Android Studio Android & Cross-Platform Mobile Apps 27
ruutaiokwu Android Studio (SDK) ANDROID_SDK_ROOT-Variable? Android & Cross-Platform Mobile Apps 5
O Web API in Android (JAVA) einbinden Android & Cross-Platform Mobile Apps 3
J Android Studio macht seltsame Sachen Android & Cross-Platform Mobile Apps 2
J Android 9.1 aber android Studio findet API22 Android & Cross-Platform Mobile Apps 0
Dimax Web-Seite in native app convertieren mit Android Studio Android & Cross-Platform Mobile Apps 8
A Android Studio: while-Schleife beginnt nicht Android & Cross-Platform Mobile Apps 5
lolcore android studio: fehler bei laden des emulators Android & Cross-Platform Mobile Apps 10
J Android App - Browser öffnen und Text eingeben/Button click auslösen Android & Cross-Platform Mobile Apps 10
A Android-Studio: 2. Layout nach kurzer Zeit aufzeigen Android & Cross-Platform Mobile Apps 2
A jpg wird im Android Studio nicht akzeptiert Android & Cross-Platform Mobile Apps 3
J Android Studio - ArrayList - Selected Item ermitteln Android & Cross-Platform Mobile Apps 13
T Android SDK-Manager startet nicht in Eclipse Android & Cross-Platform Mobile Apps 5
T Bringen mir die Java-Basics irgendetwas für die Android-Programmierung Android & Cross-Platform Mobile Apps 4
J Was soll das bedeuten ? does not require android.permission.BIND_JOB_SERVICE permission Android & Cross-Platform Mobile Apps 7
A Android Studio: ImageView verpixelt Android & Cross-Platform Mobile Apps 2
J intend Service im Android Studio Android & Cross-Platform Mobile Apps 4
L Android Android Development eventuell mit Flutter Android & Cross-Platform Mobile Apps 1
S Android Layout - welchen Typ? Android & Cross-Platform Mobile Apps 3
T Fehler Android Studio: java.net.MalformedURLException: no protocol: http%3A%2F%2Fwww.mal ..... Android & Cross-Platform Mobile Apps 2
Arif Android Android Studio: Fehler beim Einbinden fremder Bibliothek? Android & Cross-Platform Mobile Apps 2
L Android Android Contacts DB auslesen Android & Cross-Platform Mobile Apps 1
A Android Studio - App mit Nearby Android & Cross-Platform Mobile Apps 1
L Android content URI Datei einlesen Android & Cross-Platform Mobile Apps 9
N Android Game Background Service Android & Cross-Platform Mobile Apps 11
Jackii Android Android Studio Error im Testlauf ohne zu programmieren Android & Cross-Platform Mobile Apps 9
B Android Probleme mit Android Studio Android & Cross-Platform Mobile Apps 6
Excess Android Service läuft nicht in Sandby weiter Android & Cross-Platform Mobile Apps 2
B Android Projekt für Android und IOS erstellen? Android & Cross-Platform Mobile Apps 5
J App funktioniert auf Android 5, auf 6 nicht Android & Cross-Platform Mobile Apps 2
J Android Snake Android & Cross-Platform Mobile Apps 15
J Android TaschenRechner Android & Cross-Platform Mobile Apps 22
I Das Problem mit der Tastatur... android:windowSoftInputMode="adjustPan" Android & Cross-Platform Mobile Apps 1
E Wie erhalte ich Zugriff auf das Microfon? (Android Studio) Android & Cross-Platform Mobile Apps 9
C Android Programmierung speziell oder einfach Java Buch kaufen? Android & Cross-Platform Mobile Apps 3
B Android Kein Zugriff auf Telefonspeicher (Android 6) Android & Cross-Platform Mobile Apps 1
T Android Equalizer für Android Android & Cross-Platform Mobile Apps 3
L Android Android Studio - Exportierte APK funktioniert nicht Android & Cross-Platform Mobile Apps 6
L Android Methode funktioniert nicht unter Android Android & Cross-Platform Mobile Apps 3
A Beginnen mit Serverkommunikatsion in Android Studio Android & Cross-Platform Mobile Apps 6
E Android Studio Android & Cross-Platform Mobile Apps 15
L Android Android Studio Setup killt Explorer Android & Cross-Platform Mobile Apps 3
K Android Videos rendern Android & Cross-Platform Mobile Apps 1
J Variable in strings.xml (Android Studio) Android & Cross-Platform Mobile Apps 0
B Android Android Studio lässt PC abstürzen Android & Cross-Platform Mobile Apps 3
B Android App Fehler Android & Cross-Platform Mobile Apps 21
J android Spinner funktioniert nicht Android & Cross-Platform Mobile Apps 14
G Android Push Notification Android & Cross-Platform Mobile Apps 2
Light Lux Fehlermeldung unter Android Studio Android & Cross-Platform Mobile Apps 1
D Android Android Apps direkt vom Handy aus programmieren? Android & Cross-Platform Mobile Apps 2
L Android Android Kalendar Tag Ansicht Android & Cross-Platform Mobile Apps 1

Ähnliche Java Themen

Neue Themen


Oben